diff --git a/erpnext/patches/may_2012/reload_sales_invoice_pf.py b/erpnext/patches/may_2012/reload_sales_invoice_pf.py new file mode 100644 index 0000000000..63acbedef1 --- /dev/null +++ b/erpnext/patches/may_2012/reload_sales_invoice_pf.py @@ -0,0 +1,16 @@ +def execute(): + import webnotes + import webnotes.modules + res = webnotes.conn.sql("""\ + select module, name, standard from `tabPrint Format` + where name like 'Sales Invoice%'""", as_dict=1) + for r in res: + if r.get('standard')=='Yes' and \ + r.get('name') in [ + 'Sales Invoice Classic', + 'Sales Invoice Spartan', + 'Sales Invoice Modern' + ]: + print r.get('name') + webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name')) + \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 6f2f8cefd5..5a82d425a2 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -347,5 +347,10 @@ patch_list = [ 'patch_file': 'page_role_series_fix', 'description': 'reset series of page role at max' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'reload_sales_invoice_pf', + 'description': 'Reload sales invoice print formats' + }, ]