From c79f2e45a8d7e25e1e25f1f73cf08ba9ab82761f Mon Sep 17 00:00:00 2001 From: pandiyan Date: Fri, 24 Jul 2026 12:22:08 +0530 Subject: [PATCH] fix: respect user permissions in party dashboard company list use frappe.get_list instead of frappe.get_all in get_dashboard_info so the company list honors user permissions. previously, a party with invoices across multiple companies would raise "User don't have permissions to select/read this account" for users restricted to a subset of companies, since get_party_account was called for companies the user could not access. fixes frappe/erpnext#57428 (cherry picked from commit 903c87bcaa705ca997e28ec53132e308502ac6eb) --- erpnext/accounts/party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 7b726604d8e..588c544b7cd 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -858,7 +858,7 @@ def get_dashboard_info(party_type, party, loyalty_program=None): doctype = "Sales Invoice" if party_type == "Customer" else "Purchase Invoice" - companies = frappe.get_all( + companies = frappe.get_list( doctype, filters={"docstatus": 1, party_type.lower(): party}, distinct=1, fields=["company"] )