summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/api_v1
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
-rw-r--r--indoteknik_api/controllers/api_v1/category.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/indoteknik_api/controllers/api_v1/category.py b/indoteknik_api/controllers/api_v1/category.py
index b5e01d4e..22b5cb44 100644
--- a/indoteknik_api/controllers/api_v1/category.py
+++ b/indoteknik_api/controllers/api_v1/category.py
@@ -69,17 +69,7 @@ class Category(controller.Controller):
categories = request.env['website.categories.homepage'].search(query, order='sequence')
data = []
for category in categories:
- query_product = [
- ('active', '=', True),
- ('type', '=', 'product'),
- ('product_rating', '>', 0),
- ('public_categ_ids', 'child_of', [category.category_id.id])
- ]
- products = request.env['product.template'].search(query_product, order='product_rating desc', limit=12)
- # product_brands = []
- brands = request.env['x_manufactures'].search([
- ('product_tmpl_ids.public_categ_ids', 'child_of', [category.category_id.id])
- ], limit=8)
+ products = category.product_ids
data.append({
'id': category.id,
@@ -88,8 +78,6 @@ class Category(controller.Controller):
'name': category.category_id.name,
'image': request.env['ir.attachment'].api_image('website.categories.homepage', 'image', category.id),
'url': category.url,
- # 'brands': [y.x_name for y in brands],
- 'brands': [request.env['x_manufactures'].api_single_response(y) for y in brands],
'products': [request.env['product.template'].api_single_response(x) for x in products]
})
return self.response(data, headers=[('Cache-Control', 'max-age=3600, public')])