From ecd2e0f386e3d088164ba07a4da7fe4b734c2394 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 9 Mar 2015 15:42:28 +0530 Subject: [PATCH] Setup Wizard: catch duplicate entry error --- erpnext/setup/page/setup_wizard/install_fixtures.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py index e873e23a13e..324fd1cce49 100644 --- a/erpnext/setup/page/setup_wizard/install_fixtures.py +++ b/erpnext/setup/page/setup_wizard/install_fixtures.py @@ -172,4 +172,12 @@ def install(country=None): if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field): doc.flags.ignore_mandatory = True - doc.insert() + try: + doc.insert() + except NameError, e: + if e.args[0] == r.get("doctype") and e.args[2] and e.args[2].args[0] == 1062: + # duplicate entry + pass + else: + raise +