From 333e44eb471346bb56a5133e4677b889af545d10 Mon Sep 17 00:00:00 2001 From: Subin Tom <36098155+nemesis189@users.noreply.github.com> Date: Wed, 18 Aug 2021 16:17:54 +0530 Subject: [PATCH] fix: Dimension filter query fix to avoid including disabled dimensions (#26988) * reverting ot v12.7.1 * fix: Dimension filter query fix to not display disabled dimensions Co-authored-by: Subin Tom Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> --- erpnext/controllers/queries.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 21c052a391..4b4c8befa5 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -526,6 +526,9 @@ def get_filtered_dimensions(doctype, txt, searchfield, start, page_len, filters) if meta.is_tree: query_filters.append(['is_group', '=', 0]) + if meta.has_field('disabled'): + query_filters.append(['disabled', '!=', 1]) + if meta.has_field('company'): query_filters.append(['company', '=', filters.get('company')])