diff --git a/erpnext/setup/doctype/party_type/party_type.py b/erpnext/setup/doctype/party_type/party_type.py index cf72eb3bbdc..d0b2422405a 100644 --- a/erpnext/setup/doctype/party_type/party_type.py +++ b/erpnext/setup/doctype/party_type/party_type.py @@ -33,14 +33,11 @@ def get_party_type(doctype: str, txt: str, searchfield: str, start: int, page_le if filters and filters.get("account"): account_type = frappe.db.get_value("Account", filters.get("account"), "account_type") - if account_type: - if account_type in ["Receivable", "Payable"]: - # Include Employee regardless of its configured account_type, but still respect the text filter - condition_list.append( - (PartyType.account_type == account_type) | (PartyType.name == "Employee") - ) - else: - condition_list.append(PartyType.account_type == account_type) + if account_type in ["Receivable", "Payable"]: + # Include Employee regardless of its configured account_type, but still respect the text filter + condition_list.append((PartyType.account_type == account_type) | (PartyType.name == "Employee")) + else: + condition_list.append(PartyType.account_type == account_type) for condition in condition_list: get_party_type_query = get_party_type_query.where(condition)