From afb704c940942915334acd888407a3219b98f21c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 2 May 2012 14:56:00 +0530 Subject: [PATCH 1/2] rename fix in prev doctype --- erpnext/patches/may_2012/rename_prev_doctype.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 erpnext/patches/may_2012/rename_prev_doctype.py diff --git a/erpnext/patches/may_2012/rename_prev_doctype.py b/erpnext/patches/may_2012/rename_prev_doctype.py new file mode 100644 index 0000000000..162fb047cf --- /dev/null +++ b/erpnext/patches/may_2012/rename_prev_doctype.py @@ -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)) From a4561e14aabfa19849ae21eeeb2e60aaaa1a1ab6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 2 May 2012 14:58:53 +0530 Subject: [PATCH 2/2] patch list updated --- erpnext/patches/patch_list.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index e491b4c485..f5c98bc737 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -317,5 +317,10 @@ patch_list = [ 'patch_file': 'cleanup_property_setter', 'description': 'cleanup_property_setter' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'rename_prev_doctype', + 'description': 'rename prev doctype fix' + }, ]