From ebdac5db5c93d319afdd23e861a2d55f8ceb1431 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 5 Mar 2014 17:31:37 +0530 Subject: [PATCH] Fix in Pricing Rule Patch --- erpnext/patches/4_0/customer_discount_to_pricing_rule.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py index b310a1fa3c2..156630138c7 100644 --- a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py +++ b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py @@ -7,6 +7,8 @@ import frappe def execute(): frappe.reload_doc("accounts", "doctype", "pricing_rule") + frappe.db.auto_commit_on_many_writes = True + for d in frappe.db.sql("""select * from `tabCustomer Discount` where ifnull(parent, '') != '' and docstatus < 2""", as_dict=1): if not d.item_group: @@ -24,6 +26,7 @@ def execute(): "price_or_discount": "Discount", "discount_percentage": d.discount }]).insert() - + + frappe.db.auto_commit_on_many_writes = False frappe.delete_doc("DocType", "Customer Discount") \ No newline at end of file