From 984a7a7e613a914867b49eb673adb5c81ea0a587 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Thu, 17 May 2018 17:29:36 +0530 Subject: [PATCH] [item-query] change order of description terms, name first --- erpnext/controllers/queries.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 15a93bd4eb..bc18d7703a 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -157,9 +157,10 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals # scan description only if items are less than 50000 description_cond = 'or tabItem.description LIKE %(txt)s' - return frappe.db.sql("""select tabItem.name, tabItem.item_group, + return frappe.db.sql("""select tabItem.name, if(length(tabItem.item_name) > 40, concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name, + tabItem.item_group, if(length(tabItem.description) > 40, \ concat(substr(tabItem.description, 1, 40), "..."), description) as decription from tabItem