From 1732905db8154b907bccaeef92ea9e150c35004a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 14 Mar 2012 12:04:16 +0530 Subject: [PATCH] rename dt error fixed --- erpnext/patches/jan_mar_2012/rename_dt.py | 13 ++++++++++--- wnf.py | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/erpnext/patches/jan_mar_2012/rename_dt.py b/erpnext/patches/jan_mar_2012/rename_dt.py index 80cad952c8..368cb4fb9b 100644 --- a/erpnext/patches/jan_mar_2012/rename_dt.py +++ b/erpnext/patches/jan_mar_2012/rename_dt.py @@ -8,9 +8,13 @@ def execute(): # delete dt #------------- - deldt = ['Widget Control', 'Update Delivery Date Detail', 'Update Delivery Date', 'Tag Detail', 'Supplier rating', 'Stylesheet', 'Question Tag', 'PRO PP Detail', 'PRO Detail', 'PPW Detail', 'PF Detail', 'Personalize', 'Patch Util', 'Page Template', 'Module Def Role', 'Module Def Item', 'File Group', 'File Browser Control', 'File', 'Educational Qualifications', 'Earn Deduction Detail', 'DocType Property Setter', 'DocFormat', 'Contact Detail', 'BOM Report Detail', 'BOM Replace Utility Detail', 'BOM Replace Utility', 'Absent Days Detail', 'Activity Dashboard Control', 'Raw Materials Supplied', 'Setup Wizard Control', 'Company Group'] + del_mapper = ['Production Forecast-Production Planning Tool', 'Production Forecast-Production Plan'] + for d in del_mapper: + delete_doc('DocType Mapper', d) - for d in deldt: + del_dt = ['Widget Control', 'Update Delivery Date Detail', 'Update Delivery Date', 'Tag Detail', 'Supplier rating', 'Stylesheet', 'Question Tag', 'PRO PP Detail', 'PRO Detail', 'PPW Detail', 'PF Detail', 'Personalize', 'Patch Util', 'Page Template', 'Module Def Role', 'Module Def Item', 'File Group', 'File Browser Control', 'File', 'Educational Qualifications', 'Earn Deduction Detail', 'DocType Property Setter', 'Contact Detail', 'BOM Report Detail', 'BOM Replace Utility Detail', 'BOM Replace Utility', 'Absent Days Detail', 'Activity Dashboard Control', 'Raw Materials Supplied', 'Setup Wizard Control', 'Company Group'] # docformat + + for d in del_dt: delete_doc('DocType', d) @@ -82,7 +86,7 @@ def execute(): 'Bill Of Materials' : 'BOM', 'Appraisal Detail' : 'Appraisal Goal', 'Advance Allocation Detail' : 'Purchase Invoice Advance', - 'Advance Adjustment Detail' : 'Sales Invoice Advance' + 'Advance Adjustment Detail' : 'Sales Invoice Advance', 'Ledger Detail' : 'Multi Ledger Report Detail', 'TA Control' : 'Trend Analyzer Control', 'Sales and Purchase Return Wizard' : 'Sales and Purchase Return Tool', @@ -94,6 +98,8 @@ def execute(): } for d in rendt: + print d + ' --------> '+ rendt[d] + #rename rename('DocType', d, rendt[d], 1) @@ -105,6 +111,7 @@ def execute(): # RUN ONLY IN LOCAL ###################### + # replace dt in js/py file for extn in ['js', 'py', 'txt']: replace_code('/var/www/erpnext/', d, rendt[d], extn) diff --git a/wnf.py b/wnf.py index 463ecc41f2..3d26f5b68f 100755 --- a/wnf.py +++ b/wnf.py @@ -49,11 +49,11 @@ def search_replace_with_prompt(fpath, txt1, txt2): a = raw_input('Do you want to Change [y/n]?') if a=='y': c = c.replace(txt1, txt2) - tmp.append(c) + tmp.append(c) with open(fpath, 'w') as f: f.write(''.join(tmp)) - print colored('Updated in %s' % fpath, 'green') + print colored('Updated', 'green') def setup_options():