diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/mapper.py b/erpnext/subcontracting/doctype/subcontracting_receipt/mapper.py index 4927d6723c0..bf5fbd5775a 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/mapper.py +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/mapper.py @@ -125,9 +125,11 @@ def make_purchase_receipt( target_doc.save() if submit and frappe.has_permission(target_doc.doctype, "submit", target_doc): + frappe.db.savepoint("submit_subcontracting_receipt") try: target_doc.submit() except Exception as e: + frappe.db.rollback(save_point="submit_subcontracting_receipt") target_doc.add_comment("Comment", _("Submit Action Failed") + "

" + str(e)) if notify: