From c643fe5274ffe6c529b241a662431b7365e50628 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 29 Jun 2026 22:45:20 +0530 Subject: [PATCH] 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. --- erpnext/manufacturing/doctype/bom_creator/bom_creator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py index 531fe9826f9..84f10f1c1ee 100644 --- a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py +++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py @@ -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( {