From 559c16fabb6b30b2f903fc0dab2e759113f613b8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 11 Dec 2012 15:18:51 +0530 Subject: [PATCH] production cleanup patch --- patches/december_2012/production_cleanup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/december_2012/production_cleanup.py b/patches/december_2012/production_cleanup.py index 55881f2797e..0c25b895ae9 100644 --- a/patches/december_2012/production_cleanup.py +++ b/patches/december_2012/production_cleanup.py @@ -15,15 +15,18 @@ def rename_module(): webnotes.reload_doc("core", "doctype", "page") webnotes.reload_doc("core", "doctype", "module_def") - webnotes.rename_doc("Role", "Production User", "Manufacturing User") - webnotes.rename_doc("Role", "Production Manager", "Manufacturing Manager") + if webnotes.conn.exists("Role", "Production User"): + webnotes.rename_doc("Role", "Production User", "Manufacturing User") + if webnotes.conn.exists("Role", "Production Manager"): + webnotes.rename_doc("Role", "Production Manager", "Manufacturing Manager") if webnotes.conn.exists("Page", "manufacturing-home"): webnotes.delete_doc("Page", "production-home") else: webnotes.rename_doc("Page", "production-home", "manufacturing-home") - webnotes.rename_doc("Module Def", "Production", "Manufacturing") + 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"))