From e7f2d3179d42d121c612e083911ecb423a0b6de8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 12 Jun 2014 14:58:09 +0530 Subject: [PATCH] update other_charges in custom print formats --- erpnext/patches.txt | 1 + ...other_charges_in_custom_purchase_print_formats.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 erpnext/patches/v4_0/update_other_charges_in_custom_purchase_print_formats.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 8755837b70..02c651f9ed 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -58,3 +58,4 @@ execute:frappe.reset_perms("Stock Ledger Entry") #2014-06-09 erpnext.patches.v4_0.create_custom_fields_for_india_specific_fields erpnext.patches.v4_0.save_default_letterhead erpnext.patches.v4_0.update_custom_print_formats_for_renamed_fields +erpnext.patches.v4_0.update_other_charges_in_custom_purchase_print_formats diff --git a/erpnext/patches/v4_0/update_other_charges_in_custom_purchase_print_formats.py b/erpnext/patches/v4_0/update_other_charges_in_custom_purchase_print_formats.py new file mode 100644 index 0000000000..c0f9ee008f --- /dev/null +++ b/erpnext/patches/v4_0/update_other_charges_in_custom_purchase_print_formats.py @@ -0,0 +1,12 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe +import re + +def execute(): + for name, html in frappe.db.sql("""select name, html from `tabPrint Format` + where standard = 'No' and html like '%%purchase\\_tax\\_details%%'"""): + html = re.sub(r"\bpurchase_tax_details\b", "other_charges", html) + frappe.db.set_value("Print Format", name, "html", html)