mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 16:40:19 +00:00
fix(accounts): log bank-entry failure without the rolled-back doc (review)
The savepoint rollback erases the just-inserted Bank Transaction row, so bank_transaction.log_error() created an Error Log pointing at a row that no longer exists. Use frappe.log_error(title=...) with no doc reference.
This commit is contained in:
@@ -58,7 +58,7 @@ def create_bank_entries(columns: str, data: str | list, bank_account: str):
|
|||||||
success += 1
|
success += 1
|
||||||
except Exception:
|
except Exception:
|
||||||
frappe.db.rollback(save_point="bank_entry")
|
frappe.db.rollback(save_point="bank_entry")
|
||||||
bank_transaction.log_error("Bank entry creation failed")
|
frappe.log_error(title="Bank entry creation failed")
|
||||||
errors += 1
|
errors += 1
|
||||||
|
|
||||||
return {"success": success, "errors": errors}
|
return {"success": success, "errors": errors}
|
||||||
|
|||||||
Reference in New Issue
Block a user