fix(stock): log Material Request failure without the rolled-back doc (review)

After rollback(save_point=reorder_mr) discards the just-inserted Material Request, mr.log_error() left a dangling Error Log reference. Use frappe.log_error(title=...).
This commit is contained in:
Mihir Kandoi
2026-06-30 12:17:37 +05:30
parent b0331f13f1
commit 16a6a4913e

View File

@@ -290,7 +290,7 @@ def create_material_request(material_requests):
except Exception as exception:
frappe.db.rollback(save_point="reorder_mr")
exceptions_list.append(exception)
mr.log_error("Unable to create material request")
frappe.log_error(title="Unable to create material request")
if company_wise_mr:
if getattr(frappe.local, "reorder_email_notify", None) is None: