Merge pull request #14124 from pratu16x7/hotfix

[item-query] change order of description terms, name first
This commit is contained in:
Prateeksha Singh 2018-05-17 17:32:54 +05:30 committed by GitHub
commit 8233cb11ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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