synced child table docstatus with parent

This commit is contained in:
nabinhait 2011-06-15 15:17:57 +05:30
parent 2262f2a18f
commit 5f4ea817e9

View File

@ -1,6 +1,6 @@
# REMEMBER to update this
# ========================
last_patch = 281
last_patch = 282
#-------------------------------------------
@ -1129,3 +1129,9 @@ def execute(patch_no):
for dt in dt_list:
sql("update `tab%s` set status = 'Submitted' where docstatus = 1 and modified >='2011-06-15 01:00:00'" % dt)
sql("update `tab%s` set status = 'Cancelled' where docstatus = 2 and modified >='2011-06-15 01:00:00'" % dt)
elif patch_no == 282:
dt_list = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note', 'Receivable Voucher', 'Payable Voucher', 'Delivery Note', 'Purchase Receipt', 'Journal Voucher', 'Stock Entry']
for d in dt_list:
tbl = sql("select options from `tabDocField` where fieldtype = 'Table' and parent = '%s'" % d)
for t in tbl:
sql("update `tab%s` t1, `tab%s` t2 set t1.docstatus = t2.docstatus where t1.parent = t2.name" % (t[0], d))