diff --git a/erpnext/patches/v13_0/wipe_serial_no_field_for_0_qty.py b/erpnext/patches/v13_0/wipe_serial_no_field_for_0_qty.py index 30b7592466..e43a8bad8e 100644 --- a/erpnext/patches/v13_0/wipe_serial_no_field_for_0_qty.py +++ b/erpnext/patches/v13_0/wipe_serial_no_field_for_0_qty.py @@ -2,7 +2,14 @@ import frappe def execute(): - sr_item = frappe.qb.DocType("Stock Reconciliation Item") + + doctype = "Stock Reconciliation Item" + + if not frappe.db.has_column(doctype, "current_serial_no"): + # nothing to fix if column doesn't exist + return + + sr_item = frappe.qb.DocType(doctype) (frappe.qb .update(sr_item)