fix(manufacturing): rollback before marking BOM Creator failed (Postgres)

create_production_plan_bom (background job) save+submits BOMs in a loop; on failure the except runs self.db_set(status=Failed, error_log) with no rollback, raising InFailedSqlTransaction on Postgres so status is never set. Full frappe.db.rollback() at the top of the except. No-op on MariaDB.
This commit is contained in:
Mihir Kandoi
2026-06-29 22:45:20 +05:30
parent 790560ebf8
commit c643fe5274

View File

@@ -313,6 +313,7 @@ class BOMCreator(Document):
frappe.msgprint(_("BOMs created successfully"))
except Exception:
frappe.db.rollback()
traceback = frappe.get_traceback(with_context=True)
self.db_set(
{