[fix] [patch] [minor] custom print format net total export patch

This commit is contained in:
Anand Doshi 2013-07-26 11:34:16 +05:30
parent 6c0b936f35
commit 86537edd10

View File

@ -3,13 +3,14 @@ import webnotes
import re import re
def execute(): def execute():
for name, html in webnotes.conn.sql("""select name, html from `tabPrint Format` where standard='No'"""): for name, html in webnotes.conn.sql("""select name, html from `tabPrint Format` where standard='No'
changed = False and ifnull(html, '')!=''"""):
for match in re.findall("(doc.net_total.*doc.conversion_rate)", html): changed = False
if match.replace(" ", "") == "doc.net_total/doc.conversion_rate": for match in re.findall("(doc.net_total.*doc.conversion_rate)", html):
html = html.replace(match, "doc.net_total_export") if match.replace(" ", "") == "doc.net_total/doc.conversion_rate":
changed = True html = html.replace(match, "doc.net_total_export")
changed = True
if changed: if changed:
webnotes.conn.set_value("Print Format", name, "html", html) webnotes.conn.set_value("Print Format", name, "html", html)