fix(pstch): allow duplicate entries (#16632)

This commit is contained in:
sahil28297 2019-02-11 15:53:04 +05:30 committed by Faris Ansari
parent d95c8cfac3
commit 1a7e438fb2

View File

@ -27,8 +27,10 @@ def execute():
for company in companies: for company in companies:
copy_doc = frappe.copy_doc(department_doc) copy_doc = frappe.copy_doc(department_doc)
copy_doc.update({"company": company.name}) copy_doc.update({"company": company.name})
try:
copy_doc.insert() copy_doc.insert()
except frappe.DuplicateEntryError:
pass
# append list of new department for each company # append list of new department for each company
comp_dict[company.name][department.name] = copy_doc.name comp_dict[company.name][department.name] = copy_doc.name