fix: remove empty dn from bulk creation if date filter renders them empty

This commit is contained in:
David Arnold
2024-01-30 12:59:26 +01:00
parent 12a4f2761c
commit 9a705169fd
2 changed files with 11 additions and 3 deletions

View File

@@ -156,9 +156,12 @@ def task(doc_name, from_doctype, to_doctype):
else:
obj = mapper[from_doctype][to_doctype](doc_name)
obj.flags.ignore_validate = True
obj.set_title_field()
obj.insert(ignore_mandatory=True)
if obj:
obj.flags.ignore_validate = True
obj.set_title_field()
obj.insert(ignore_mandatory=True)
del obj
del frappe.flags.bulk_transaction