fieldname changed in features setup and required patch

This commit is contained in:
Nabin Hait
2011-09-30 20:15:39 +05:30
parent d4694763f6
commit 2ce051284a
3 changed files with 56 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
# REMEMBER to update this
# ========================
last_patch = 370
last_patch = 371
#-------------------------------------------
@@ -361,6 +361,21 @@ 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:
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']
for f in flds:
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 `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st)
get_obj('Features Setup', 'Features Setup').doc.save()
elif patch_no == 372:
comp = sql("select name from tabCompany where docstatus!=2")
fy = sql("select name from `tabFiscal Year` order by year_start_date asc")
for c in comp: