rename fix in prev doctype

This commit is contained in:
Nabin Hait 2012-05-02 14:56:00 +05:30
parent a4e9a52ea3
commit afb704c940

View File

@ -0,0 +1,14 @@
def execute():
import webnotes
dt_list = webnotes.conn.sql("select parent, fieldname from `tabDocField` where fieldname in ('against_doctype', 'prevdoc_doctype')")
ren_dt = {
'Indent' : 'Purchase Request',
'Enquiry' : 'Opportunity',
'Receivable Voucher' : 'Sales Invoice',
'Payable Voucher' : 'Purchase Invoice'
}
for d in ren_dt:
for dt in dt_list:
webnotes.conn.sql("update `tab%s` set %s = '%s' where %s = '%s'" % (dt[0], dt[1], ren_dt[d], dt[1], d))