From 41cd5a68f4099ad955f8dbee54655cf0154762cb Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 31 Aug 2012 13:57:22 +0530 Subject: [PATCH] autocommit for price list update --- erpnext/setup/doctype/price_list/price_list.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/price_list/price_list.py b/erpnext/setup/doctype/price_list/price_list.py index be59c65816..73ec12b216 100644 --- a/erpnext/setup/doctype/price_list/price_list.py +++ b/erpnext/setup/doctype/price_list/price_list.py @@ -51,7 +51,8 @@ class DocType: # update prices in Price List def update_prices(self): - import csv + webnotes.conn.auto_commit_on_many_writes = 1 + import csv data = csv.reader(self.get_csv_data().splitlines()) updated = 0 @@ -84,6 +85,7 @@ class DocType: msgprint("[Ignored] Incorrect format: %s" % str(line)) msgprint("%s items updated" % updated) + webnotes.conn.auto_commit_on_many_writes = 0 # clear prices def clear_prices(self):