fix: not able to select item in sales order

This commit is contained in:
Rohit Waghchaure 2019-11-19 19:05:23 +05:30
parent a85ddf2fb4
commit c42312ea12

View File

@ -159,8 +159,12 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
if "description" in searchfields: if "description" in searchfields:
searchfields.remove("description") searchfields.remove("description")
columns = [field for field in searchfields if not field in ["name", "item_group", "description"]] columns = ''
columns = ", ".join(columns) extra_searchfields = [field for field in searchfields
if not field in ["name", "item_group", "description"]]
if extra_searchfields:
columns = ", " + ", ".join(extra_searchfields)
searchfields = searchfields + [field for field in[searchfield or "name", "item_code", "item_group", "item_name"] searchfields = searchfields + [field for field in[searchfield or "name", "item_code", "item_group", "item_name"]
if not field in searchfields] if not field in searchfields]
@ -176,7 +180,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name, concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name,
tabItem.item_group, tabItem.item_group,
if(length(tabItem.description) > 40, \ if(length(tabItem.description) > 40, \
concat(substr(tabItem.description, 1, 40), "..."), description) as description, concat(substr(tabItem.description, 1, 40), "..."), description) as description
{columns} {columns}
from tabItem from tabItem
where tabItem.docstatus < 2 where tabItem.docstatus < 2