diff options
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/category.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/category.py b/indoteknik_api/controllers/api_v1/category.py index a673e42f..09b8ff8c 100644 --- a/indoteknik_api/controllers/api_v1/category.py +++ b/indoteknik_api/controllers/api_v1/category.py @@ -62,7 +62,8 @@ class Category(controller.Controller): if depth > 2: return 0 child_categories = request.env['product.public.category'].search([('parent_frontend_id', '=', category.id)]) - num_found = len(category.product_tmpl_ids) + # Fetch products that are not unpublished + num_found = len(category.product_tmpl_ids.filtered(lambda p: not p.unpublished)) for child in child_categories: num_found += compute_num_found(child, depth + 1, start_depth) return num_found |
