diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py index df365528c3e..01f71c9a1eb 100644 --- a/erpnext/hub_node/__init__.py +++ b/erpnext/hub_node/__init__.py @@ -31,12 +31,12 @@ def get_meta(doctype): return meta @frappe.whitelist() -def get_categories(): +def get_categories(parent='All Categories'): # get categories info with parent category and stuff connection = get_client_connection() - categories = connection.get_list('Hub Category') - print("============================================================") - print(categories) + categories = connection.get_list('Hub Category', filters={'parent_hub_category': parent}) + # print("============================================================") + # print(categories) response = [{'value': c.get('name'), 'expandable': c.get('is_group')} for c in categories] return response diff --git a/erpnext/public/js/hub/hub_page.js b/erpnext/public/js/hub/hub_page.js index 2ca5eacbbce..beea480a482 100644 --- a/erpnext/public/js/hub/hub_page.js +++ b/erpnext/public/js/hub/hub_page.js @@ -120,7 +120,7 @@ erpnext.hub.ItemListing = class ItemListing extends erpnext.hub.HubListing { label: 'All Categories', expandable: true, - args: {}, + args: {parent: this.current_category}, method: 'erpnext.hub_node.get_categories', on_click: (node) => { this.update_category(node.label); @@ -186,12 +186,6 @@ erpnext.hub.CompanyListing = class CompanyListing extends erpnext.hub.HubListing this.fields = ['company_logo', 'name', 'site_name', 'seller_city', 'seller_description', 'seller', 'country', 'company_name']; this.filters = []; this.custom_filter_configs = [ - { - fieldtype: 'Data', - label: 'Company', - condition: 'like', - fieldname: 'company_name', - }, { fieldtype: 'Link', label: 'Country',