diff --git a/patches/patch.py b/patches/patch.py index 8177e87f7e..cdfbbb6c6d 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()