From dae8f1b353e86a7e9b12a615396e1ddcb3acff6d Mon Sep 17 00:00:00 2001 From: creador30 Date: Fri, 4 May 2018 15:42:03 +0300 Subject: [PATCH] Search for item_code (#13912) Item query can be called from custom script to search for an additional field. In this case the item_name, item_group and item_description are still searchable, but not item_code. As the item code is a must have field in search results, I have added this to the non-changable search fields in this query. --- erpnext/controllers/queries.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index fd13c1353e..2ba32ce58c 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -168,6 +168,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals and tabItem.disabled=0 and (tabItem.end_of_life > %(today)s or ifnull(tabItem.end_of_life, '0000-00-00')='0000-00-00') and (tabItem.`{key}` LIKE %(txt)s + or tabItem.item_code LIKE %(txt)s or tabItem.item_group LIKE %(txt)s or tabItem.item_name LIKE %(txt)s or tabItem.item_code IN (select parent from `tabItem Barcode` where barcode LIKE %(txt)s