From ac16f3b71fc403d2ad1f37f7ca54dc6236aa909c Mon Sep 17 00:00:00 2001 From: rahib-hassan Date: Fri, 8 Apr 2022 18:20:41 +0530 Subject: [PATCH] fix: lock timeout exceeded --- .../patches/v14_0/discount_accounting_separation.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/erpnext/patches/v14_0/discount_accounting_separation.py b/erpnext/patches/v14_0/discount_accounting_separation.py index e7e4a2ebcf..3d4907cca3 100644 --- a/erpnext/patches/v14_0/discount_accounting_separation.py +++ b/erpnext/patches/v14_0/discount_accounting_separation.py @@ -4,11 +4,5 @@ def execute(): doc = frappe.get_doc("Accounts Settings") discount_account = doc.enable_discount_accounting if discount_account: - buying_settings = frappe.get_doc("Buying Settings", "Buying Settings") - selling_settings = frappe.get_doc("Selling Settings", "Selling Settings") - - buying_settings.enable_discount_accounting = 1 - selling_settings.enable_discount_accounting = 1 - - buying_settings.save() - selling_settings.save() \ No newline at end of file + for doctype in ["Buying Settings", "Selling Settings"]: + doc = frappe.db.set_value(doctype, doctype, 'enable_discount_accounting', 1, update_modified=False) \ No newline at end of file