From 65ce737c2dbbd5e76bb152c3070d12be1e2f9e0d Mon Sep 17 00:00:00 2001 From: venkat102 Date: Thu, 4 Sep 2025 21:00:52 +0530 Subject: [PATCH] fix: add condition for name (cherry picked from commit cf5a2d6351c9e98ffc828c09e8cf0ecd7378a765) --- erpnext/accounts/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 3c0485798b1..18cbc65731c 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -2475,6 +2475,10 @@ def build_qb_match_conditions(doctype, user=None) -> list: for filter in match_filters: for link_option, allowed_values in filter.items(): fieldnames = link_fields_map.get(link_option, []) + cond = None + + if link_option == doctype: + cond = _dt["name"].isin(allowed_values) for fieldname in fieldnames: field = _dt[fieldname] @@ -2483,6 +2487,7 @@ def build_qb_match_conditions(doctype, user=None) -> list: if not apply_strict_user_permissions: cond = (Coalesce(field, "") == "") | cond + if cond: criterion.append(cond) return criterion