From 8c0b4a99cf80f84ab727c8763402eab7566a6774 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 29 Jun 2026 22:42:48 +0530 Subject: [PATCH] fix(setup): rollback before logging in install_country_fixtures (Postgres) Regional fixture setup writes docs; on failure the except calls frappe.log_error before frappe.throw with no rollback -> InFailedSqlTransaction on Postgres. Full rollback before log_error. No-op on MariaDB. --- erpnext/setup/doctype/company/company.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 59064847173..5bd0ee104f0 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -856,6 +856,7 @@ def install_country_fixtures(company, country): except ImportError: pass except Exception: + frappe.db.rollback() frappe.log_error("Unable to set country fixtures") frappe.throw( _("Failed to setup defaults for country {0}. Please contact support.").format(