From 04021a5803b48ef155964c58aabdb59012ef8a2f Mon Sep 17 00:00:00 2001 From: Vishnu Priya Baskaran <145791817+ervishnucs@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:26:58 +0530 Subject: [PATCH] fix: allow non-admin roles to import chart of accounts (#57454) (cherry picked from commit 89e2c3c3e56b0a8cbfe82b34bb0e7132893dc3d7) # Conflicts: # erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py --- .../chart_of_accounts_importer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py index eeaa5abfc6d..d999d218a60 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py @@ -455,6 +455,7 @@ def unset_existing_data(company): frappe.db.set_value("Company", company, update_values, update_values) # remove accounts data from various doctypes +<<<<<<< HEAD for doctype in [ "Account", "Party Account", @@ -465,6 +466,13 @@ def unset_existing_data(company): ]: dt = frappe.qb.DocType(doctype) frappe.qb.from_(dt).where(dt.company == company).delete().run() +======= + for doctype in ["Account", "Sales Taxes and Charges Template", "Purchase Taxes and Charges Template"]: + frappe.get_query(doctype, delete=True, filters={"company": company}, ignore_permissions=False).run() +>>>>>>> 89e2c3c3e5 (fix: allow non-admin roles to import chart of accounts (#57454)) + + for doctype in ["Party Account", "Mode of Payment Account", "Tax Withholding Account"]: + frappe.get_query(doctype, delete=True, filters={"company": company}, ignore_permissions=True).run() def set_default_accounts(company):