[fix] catch DuplicateEntryError in install_fixtures step of Setup Wizard
diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py
index 02fa27f..ba48a29 100644
--- a/erpnext/setup/page/setup_wizard/install_fixtures.py
+++ b/erpnext/setup/page/setup_wizard/install_fixtures.py
@@ -190,4 +190,14 @@
parent_link_field = ("parent_" + scrub(doc.doctype))
if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field):
doc.flags.ignore_mandatory = True
- doc.insert(ignore_permissions=True)
+
+ try:
+ doc.insert(ignore_permissions=True)
+ except frappe.DuplicateEntryError, e:
+ # pass DuplicateEntryError and continue
+ if e.args and e.args[0]==doc.doctype and e.args[1]==doc.name:
+ # make sure DuplicateEntryError is for the exact same doc and not a related doc
+ pass
+ else:
+ raise
+