Rollback if scheduled submit/cancel failed

This commit is contained in:
Nabin Hait 2016-10-06 11:20:45 +05:30 committed by GitHub
parent 171712ec87
commit 9bf71bba3d

View file

@ -999,6 +999,8 @@ def execute_action(doctype, name, action, **kwargs):
try:
getattr(doc, action)(**kwargs)
except Exception:
frappe.db.rollback()
# add a comment (?)
if frappe.local.message_log:
msg = json.loads(frappe.local.message_log[-1]).get('message')