summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/api_v1
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-07-27 06:32:29 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-07-27 06:32:29 +0000
commitff387e15f5e9adc167dd70626391123975be5c77 (patch)
tree5ae74a070cf774cb6753755bcb3b62bec5bef26c /indoteknik_api/controllers/api_v1
parente1c3b8cd1b4d90db4de42a5a58ba17b5f4d6c293 (diff)
parenta7057cc2fd5bd800d7b75f101aec9b67cdbe0053 (diff)
Merged in feature/iman-categories-homepage (pull request #185)
<iman> update numFound not published
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
-rw-r--r--indoteknik_api/controllers/api_v1/category.py3
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