From 92c999afcbfe0c0e2e940a1f53b00369deb9b6df Mon Sep 17 00:00:00 2001 From: Saqib Date: Fri, 24 Jan 2020 16:23:05 +0530 Subject: [PATCH] fix: wrong outstanding invoices fetched against employee (#20374) --- erpnext/accounts/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index e01d6d5dc7f..5ad8cb50d5f 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -640,8 +640,9 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2 if account: - root_type = frappe.get_cached_value("Account", account, "root_type") + root_type, account_type = frappe.get_cached_value("Account", account, ["root_type", "account_type"]) party_account_type = "Receivable" if root_type == "Asset" else "Payable" + party_account_type = account_type or party_account_type else: party_account_type = erpnext.get_party_account_type(party_type)