[minor] [patch] replace doc.net_total/doc.conversion_rate with doc.net_total_export in custom print formats

This commit is contained in:
Anand Doshi
2013-07-22 15:37:48 +05:30
parent 5539333c8d
commit d81c320a32
2 changed files with 28 additions and 9 deletions

View File

@@ -0,0 +1,15 @@
from __future__ import unicode_literals
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
if changed:
webnotes.conn.set_value("Print Format", name, "html", html)