[hub][publish] add search, fix multiple append

This commit is contained in:
Prateeksha Singh
2018-07-26 08:36:33 +05:30
parent 505f6f14e9
commit 1d1696080e
2 changed files with 34 additions and 4 deletions

View File

@@ -33,8 +33,13 @@ def get_list(doctype, start=0, limit=20, fields=["*"], filters="{}", order_by=No
#### LOCAL ITEMS
@frappe.whitelist()
def get_valid_items():
items = frappe.get_list('Item', fields=["*"])
def get_valid_items(search_value=''):
items = frappe.get_list('Item', fields=["*"], filters={
'item_name': ['like', '%' + search_value + '%']
})
print([d.item_name for d in items])
valid_items = filter(lambda x: x.image and x.description, items)
def attach_source_type(item):