fix(bulk-update): Rollback on exceptions

This commit is contained in:
Nabin Hait 2018-10-31 15:45:06 +05:30 committed by Aditya Hase
parent ca72c772f1
commit 8a1c762a7c

View file

@ -54,11 +54,12 @@ def submit_cancel_or_update_docs(doctype, docnames, action='submit', data=None):
message = _('Updating {0}').format(doctype)
else:
failed.append(d)
frappe.db.commit()
show_progress(docnames, message, i, d)
except Exception:
failed.append(d)
frappe.db.rollback()
return failed