mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-21 18:36:30 +00:00
fix: broken test suite due to incorrect OR filter
(cherry picked from commit 37d74e387d)
This commit is contained in:
@@ -214,13 +214,12 @@ def get_or_create_account(company_name, account):
|
|||||||
default_root_type = "Liability"
|
default_root_type = "Liability"
|
||||||
root_type = account.get("root_type", default_root_type)
|
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(
|
existing_accounts = frappe.get_all(
|
||||||
"Account",
|
"Account", filters={"company": company_name, "root_type": root_type}, or_filters=or_filters
|
||||||
filters={"company": company_name, "root_type": root_type},
|
|
||||||
or_filters={
|
|
||||||
"account_name": account.get("account_name"),
|
|
||||||
"account_number": account.get("account_number"),
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if existing_accounts:
|
if existing_accounts:
|
||||||
|
|||||||
Reference in New Issue
Block a user