diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py index a94f6b1615b..138ff1e40e7 100644 --- a/erpnext/hub_node/__init__.py +++ b/erpnext/hub_node/__init__.py @@ -31,12 +31,18 @@ def get_list(doctype, start=0, limit=20, fields=["*"], filters="{}", order_by=No return listing - - +#### LOCAL ITEMS @frappe.whitelist() def get_valid_items(): - items = frappe.get_list('Item') - return items + items = frappe.get_list('Item', fields=["*"]) + valid_items = filter(lambda x: x.image and x.description, items) + + def attach_source_type(item): + item.source_type = "local" + return item + + valid_items = map(lambda x: attach_source_type(x), valid_items) + return valid_items @frappe.whitelist() def get_item_favourites(start=0, limit=20, fields=["*"], order_by=None): diff --git a/erpnext/public/js/hub/hub_listing.js b/erpnext/public/js/hub/hub_listing.js index 218960bb171..856d538dd2b 100644 --- a/erpnext/public/js/hub/hub_listing.js +++ b/erpnext/public/js/hub/hub_listing.js @@ -26,6 +26,8 @@ erpnext.hub.Marketplace = class Marketplace { const $target = $(e.currentTarget); const route = $target.data().route; frappe.set_route(route); + + e.stopPropagation(); }); } @@ -43,6 +45,12 @@ erpnext.hub.Marketplace = class Marketplace {
${subtitle}
+ + ${search_html}
- Products by Blah blah
-