update other_charges in custom print formats

This commit is contained in:
Nabin Hait 2014-06-12 14:58:09 +05:30
parent 46dc3b1442
commit e7f2d3179d
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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)