From 903c87bcaa705ca997e28ec53132e308502ac6eb 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 --- 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 6244dbc954b..a962dcff459 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -869,7 +869,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"] )