fix: not able to select the item code in work order
This commit is contained in:
parent
d0ba0217e4
commit
5dd92934ae
@ -204,7 +204,7 @@ 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 = ''
|
columns = ''
|
||||||
extra_searchfields = [field for field in searchfields
|
extra_searchfields = [field for field in searchfields
|
||||||
if not field in ["name", "item_group", "description"]]
|
if not field in ["name", "item_group", "description"]]
|
||||||
@ -216,9 +216,10 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
|
|||||||
if not field in searchfields]
|
if not field in searchfields]
|
||||||
searchfields = " or ".join([field + " like %(txt)s" for field in searchfields])
|
searchfields = " or ".join([field + " like %(txt)s" for field in searchfields])
|
||||||
|
|
||||||
if filters.get('supplier'):
|
if filters and isinstance(filters, dict) and filters.get('supplier'):
|
||||||
item_group_list = frappe.get_all('Supplier Item Group', filters = {'supplier': filters.get('supplier')}, fields = ['item_group'])
|
item_group_list = frappe.get_all('Supplier Item Group',
|
||||||
|
filters = {'supplier': filters.get('supplier')}, fields = ['item_group'])
|
||||||
|
|
||||||
item_groups = []
|
item_groups = []
|
||||||
for i in item_group_list:
|
for i in item_group_list:
|
||||||
item_groups.append(i.item_group)
|
item_groups.append(i.item_group)
|
||||||
@ -227,7 +228,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
|
|||||||
|
|
||||||
if item_groups:
|
if item_groups:
|
||||||
filters['item_group'] = ['in', item_groups]
|
filters['item_group'] = ['in', item_groups]
|
||||||
|
|
||||||
description_cond = ''
|
description_cond = ''
|
||||||
if frappe.db.count('Item', cache=True) < 50000:
|
if frappe.db.count('Item', cache=True) < 50000:
|
||||||
# scan description only if items are less than 50000
|
# scan description only if items are less than 50000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user