[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
def execute():
for name, html in webnotes.conn.sql("""select name, html from `tabPrint Format` where standard='No'"""):
changed = False
for match in re.findall("(doc.net_total.*doc.conversion_rate)", html):
if match.replace(" ", "") == "doc.net_total/doc.conversion_rate":
html = html.replace(match, "doc.net_total_export")
changed = True
for name, html in webnotes.conn.sql("""select name, html from `tabPrint Format` where standard='No'
and ifnull(html, '')!=''"""):
changed = False
for match in re.findall("(doc.net_total.*doc.conversion_rate)", html):
if match.replace(" ", "") == "doc.net_total/doc.conversion_rate":
html = html.replace(match, "doc.net_total_export")
changed = True
if changed:
webnotes.conn.set_value("Print Format", name, "html", html)
if changed:
webnotes.conn.set_value("Print Format", name, "html", html)