fix: broken test suite due to incorrect OR filter

(cherry picked from commit 37d74e387d)
This commit is contained in:
ruthra kumar
2025-05-02 15:45:46 +05:30
committed by Mergify
parent 558225b027
commit 949ed59f84

View File

@@ -207,13 +207,12 @@ def get_or_create_account(company_name, account):
default_root_type = "Liability"
root_type = account.get("root_type", default_root_type)
or_filters = {"account_name": account.get("account_name")}
if account.get("account_number"):
or_filters.update({"account_number": account.get("account_number")})
existing_accounts = frappe.get_all(
"Account",
filters={"company": company_name, "root_type": root_type},
or_filters={
"account_name": account.get("account_name"),
"account_number": account.get("account_number"),
},
"Account", filters={"company": company_name, "root_type": root_type}, or_filters=or_filters
)
if existing_accounts: