From 5556cbe51dace8c1ff8905be5851d74a4c54b86e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 30 Sep 2011 20:36:56 +0530 Subject: [PATCH] features setup patch fixed --- patches/patch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index 8177e87f7eb..cdfbbb6c6da 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -361,6 +361,8 @@ def execute(patch_no): elif patch_no == 370: sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'") elif patch_no == 371: + from webnotes.modules.module_manager import reload_doc + reload_doc('setup', 'doctype','features_setup') flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_serial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos'] @@ -368,9 +370,9 @@ def execute(patch_no): val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f) val = val and val[0][0] or 0 sql("update `tabSingles` set value = %s where field = '%s' and doctype = 'Features Setup'" % (val, '__'+f)) - + st = "'"+"', '".join(flds)+"'" - sql("delete from `tabSingles` where field in (%s) and doctype = 'Features Setup'" % st) + sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st) sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) get_obj('Features Setup', 'Features Setup').doc.save()