[minor] fixed patch

This commit is contained in:
Anand Doshi 2013-07-16 20:56:38 +05:30
parent d618b6e1ab
commit a1299dd652

View File

@ -3,6 +3,8 @@ import json
from webnotes.utils import flt from webnotes.utils import flt
def execute(): def execute():
webnotes.conn.auto_commit_on_many_writes = 1
for doctype in ["Purchase Taxes and Charges", "Sales Taxes and Charges"]: for doctype in ["Purchase Taxes and Charges", "Sales Taxes and Charges"]:
for tax_name, item_wise_tax_detail in \ for tax_name, item_wise_tax_detail in \
webnotes.conn.sql("""select name, item_wise_tax_detail from `tab%s`""" % doctype): webnotes.conn.sql("""select name, item_wise_tax_detail from `tab%s`""" % doctype):
@ -21,3 +23,5 @@ def execute():
if out: if out:
webnotes.conn.sql("""update `tab%s` set item_wise_tax_detail=%s webnotes.conn.sql("""update `tab%s` set item_wise_tax_detail=%s
where name=%s""" % (doctype, "%s", "%s"), (json.dumps(out), tax_name)) where name=%s""" % (doctype, "%s", "%s"), (json.dumps(out), tax_name))
webnotes.conn.auto_commit_on_many_writes = 0