From 0c7911d0fe827ca6a6feddd5e09e2c878bd89fc2 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 859805f082e..ebbd881c070 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -2219,6 +2219,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] @@ -2227,6 +2231,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