tree parent working
This commit is contained in:
parent
25d5a1d890
commit
6ee035ba5b
@ -31,12 +31,12 @@ def get_meta(doctype):
|
|||||||
return meta
|
return meta
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_categories():
|
def get_categories(parent='All Categories'):
|
||||||
# get categories info with parent category and stuff
|
# get categories info with parent category and stuff
|
||||||
connection = get_client_connection()
|
connection = get_client_connection()
|
||||||
categories = connection.get_list('Hub Category')
|
categories = connection.get_list('Hub Category', filters={'parent_hub_category': parent})
|
||||||
print("============================================================")
|
# print("============================================================")
|
||||||
print(categories)
|
# print(categories)
|
||||||
response = [{'value': c.get('name'), 'expandable': c.get('is_group')} for c in categories]
|
response = [{'value': c.get('name'), 'expandable': c.get('is_group')} for c in categories]
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ erpnext.hub.ItemListing = class ItemListing extends erpnext.hub.HubListing {
|
|||||||
label: 'All Categories',
|
label: 'All Categories',
|
||||||
expandable: true,
|
expandable: true,
|
||||||
|
|
||||||
args: {},
|
args: {parent: this.current_category},
|
||||||
method: 'erpnext.hub_node.get_categories',
|
method: 'erpnext.hub_node.get_categories',
|
||||||
on_click: (node) => {
|
on_click: (node) => {
|
||||||
this.update_category(node.label);
|
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.fields = ['company_logo', 'name', 'site_name', 'seller_city', 'seller_description', 'seller', 'country', 'company_name'];
|
||||||
this.filters = [];
|
this.filters = [];
|
||||||
this.custom_filter_configs = [
|
this.custom_filter_configs = [
|
||||||
{
|
|
||||||
fieldtype: 'Data',
|
|
||||||
label: 'Company',
|
|
||||||
condition: 'like',
|
|
||||||
fieldname: 'company_name',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
fieldtype: 'Link',
|
fieldtype: 'Link',
|
||||||
label: 'Country',
|
label: 'Country',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user