[hub] fix company page routing

This commit is contained in:
Faris Ansari
2017-10-11 15:46:21 +05:30
parent 9893a2d608
commit 7997271368
2 changed files with 33 additions and 22 deletions

View File

@@ -15,13 +15,16 @@ def enable_hub():
return hub_settings
@frappe.whitelist()
def get_items(start=0, limit=20, category=None, order_by=None, text=None):
def get_items(start=0, limit=20, category=None, order_by=None, company=None, text=None):
connection = get_connection()
filters = {
'hub_category': category,
}
if text:
filters.update({'item_name': ('like', '%' + text + '%')})
if company:
filters.update({'company_name': company})
response = connection.get_list('Hub Item',
limit_start=start, limit_page_length=limit,
filters=filters)