mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
Setup Wizard: catch duplicate entry error
This commit is contained in:
@@ -172,4 +172,12 @@ def install(country=None):
|
|||||||
if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field):
|
if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field):
|
||||||
doc.flags.ignore_mandatory = True
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user