From 1523b383156e9fd144d4b9096c33a1003a39f913 Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Tue, 27 May 2025 14:48:25 +0530 Subject: [PATCH] fix: patch to set grand total to default mop if old column exists (#47731) * fix: patch to set grand total to default mop if old column exists * chore: patches.txt --- erpnext/patches/v15_0/set_grand_total_to_default_mop.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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()