From 86537edd10a58fcb6af521adf37c36d1e4cd9296 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 26 Jul 2013 11:34:16 +0530 Subject: [PATCH] [fix] [patch] [minor] custom print format net total export patch --- .../p08_custom_print_format_net_total_export.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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