From 8ac9e687bd2dbe51685e688c393d59659eb4caec Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 20 Dec 2012 16:53:33 +0530 Subject: [PATCH] fix in patch --- patches/december_2012/production_cleanup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/december_2012/production_cleanup.py b/patches/december_2012/production_cleanup.py index 46eb9e584d..5880448c59 100644 --- a/patches/december_2012/production_cleanup.py +++ b/patches/december_2012/production_cleanup.py @@ -30,8 +30,10 @@ def rename_module(): if webnotes.conn.exists("Module Def", "Production"): webnotes.rename_doc("Module Def", "Production", "Manufacturing") - webnotes.conn.set_global("modules_list", - webnotes.conn.get_global('modules_list').replace("Production", "Manufacturing")) + modules_list = webnotes.conn.get_global('modules_list') + if modules_list: + webnotes.conn.set_global("modules_list", modules_list.replace("Production", + "Manufacturing")) # set end of life to null if "0000-00-00" webnotes.conn.sql("""update `tabItem` set end_of_life=null where end_of_life='0000-00-00'""")