From 4f09728415917729c940a46633ad0d3d6c4f9664 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 7 Apr 2025 14:24:13 +0530 Subject: [PATCH] fix: removed hardcoded search fields to fix performance issue --- erpnext/manufacturing/doctype/bom/bom.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 8f7ba12061f..b151c92bfe6 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -1558,16 +1558,8 @@ def item_query(doctype, txt, searchfield, start, page_len, filters): fields = ["name", "item_name", "item_group", "description"] fields.extend([field for field in searchfields if field not in ["name", "item_group", "description"]]) - searchfields = searchfields + [ - field - for field in [ - searchfield or "name", - "item_code", - "item_group", - "item_name", - ] - if field not in searchfields - ] + if not searchfields: + searchfields = ["name"] query_filters = {"disabled": 0, "ifnull(end_of_life, '3099-12-31')": (">", today())} -- GitLab