Merge pull request #57772 from aerele/fix/party-dashboard-doctype-permission

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

View File

@@ -865,9 +865,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"]