diff --git a/patches/july_2013/p08_custom_print_format_net_total_export.py b/patches/july_2013/p08_custom_print_format_net_total_export.py index a6a833537b..c848ac9d62 100644 --- a/patches/july_2013/p08_custom_print_format_net_total_export.py +++ b/patches/july_2013/p08_custom_print_format_net_total_export.py @@ -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) \ No newline at end of file