From 4d705590b7289d5c1a8279261af86ee3a4c8ab3d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 18 Apr 2013 16:21:42 +0530 Subject: [PATCH] [patch] [default cost center] defaults starting with colon like :Company should not be a part of database default spec --- patches/april_2013/p06_default_cost_center.py | 10 ++++++++++ patches/patch_list.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 patches/april_2013/p06_default_cost_center.py diff --git a/patches/april_2013/p06_default_cost_center.py b/patches/april_2013/p06_default_cost_center.py new file mode 100644 index 0000000000..4f80d95d0e --- /dev/null +++ b/patches/april_2013/p06_default_cost_center.py @@ -0,0 +1,10 @@ +import webnotes + +def execute(): + for dt, fieldname in \ + (("Journal Voucher Detail", "cost_center"), + ("Sales Taxes and Charges", "cost_center_other_charges"), + ("Purchase Taxes and Charges", "cost_center"), ("Delivery Note Item", "cost_center"), + ("Purchase Invoice Item", "cost_center"), ("Sales Invoice Item", "cost_center")): + webnotes.conn.sql_ddl("""alter table `tab%s` alter `%s` drop default""" % (dt, fieldname)) + webnotes.reload_doc(webnotes.conn.get_value("DocType", dt, "module"), "DocType", dt) diff --git a/patches/patch_list.py b/patches/patch_list.py index 79e6f59c7e..f6a599694d 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -241,5 +241,6 @@ patch_list = [ "execute:webnotes.delete_doc('Search Criteria', 'time_log_summary')", "patches.april_2013.p04_update_role_in_pages", "patches.april_2013.p05_fixes_in_reverse_modules", - "execute:webnotes.delete_doc('DocType Mapper', 'Delivery Note-Packing Slip')" + "execute:webnotes.delete_doc('DocType Mapper', 'Delivery Note-Packing Slip')", + "patches.april_2013.p06_default_cost_center", ] \ No newline at end of file