From ff7d73e418cd5ae29fb6f93e3e0e20ba12c900b1 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Sun, 10 Dec 2017 20:46:46 +0100 Subject: [PATCH] - query fix --- erpnext/controllers/queries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index d2df30d84d..93d6e427e6 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -166,7 +166,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals or tabItem.item_group LIKE %(txt)s or tabItem.item_name LIKE %(txt)s or tabItem.description LIKE %(txt)s) - or tabItem.name IN (select parent from `tabItem Barcode` where barcode LIKE %(txt)s) + or tabItem.item_code IN (select parent from `tabItem Barcode` where barcode LIKE %(txt)s) {fcond} {mcond} order by if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),