Merge pull request #57784 from frappe/mergify/bp/version-15-hotfix/pr-57772

fix(accounts): skip party dashboard without invoice permission (backport #57772)
This commit is contained in:
Mihir Kandoi
2026-08-04 16:59:39 +05:30
committed by GitHub

View File

@@ -849,9 +849,11 @@ def validate_account_party_type(self):
def get_dashboard_info(party_type, party, loyalty_program=None):
current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True)
doctype = "Sales Invoice" if party_type == "Customer" else "Purchase Invoice"
if not frappe.has_permission(doctype, "read"):
return None
current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True)
companies = frappe.get_list(
doctype, filters={"docstatus": 1, party_type.lower(): party}, distinct=1, fields=["company"]