diff --git a/erpnext/patches/v15_0/set_grand_total_to_default_mop.py b/erpnext/patches/v15_0/set_grand_total_to_default_mop.py index 742fee0b775..6defd651b76 100644 --- a/erpnext/patches/v15_0/set_grand_total_to_default_mop.py +++ b/erpnext/patches/v15_0/set_grand_total_to_default_mop.py @@ -2,8 +2,9 @@ import frappe def execute(): - POSProfile = frappe.qb.DocType("POS Profile") + if frappe.db.has_column("POS Profile", "disable_grand_total_to_default_mop"): + POSProfile = frappe.qb.DocType("POS Profile") - frappe.qb.update(POSProfile).set(POSProfile.set_grand_total_to_default_mop, 1).where( - POSProfile.disable_grand_total_to_default_mop == 0 - ).run() + frappe.qb.update(POSProfile).set(POSProfile.set_grand_total_to_default_mop, 1).where( + POSProfile.disable_grand_total_to_default_mop == 0 + ).run()