tree parent working

This commit is contained in:
Prateeksha Singh 2018-02-15 08:50:31 +05:30
parent 25d5a1d890
commit 6ee035ba5b
2 changed files with 5 additions and 11 deletions

View File

@ -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

View File

@ -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',