diff options
| -rw-r--r-- | indoteknik_custom/models/find_page.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/indoteknik_custom/models/find_page.py b/indoteknik_custom/models/find_page.py index 463092ce..b7ad7f49 100644 --- a/indoteknik_custom/models/find_page.py +++ b/indoteknik_custom/models/find_page.py @@ -46,18 +46,10 @@ class FindPage(models.Model): for category in categories: category_hierarchy = self._get_category_hierarchy(category.category_id) - for level, cat in enumerate(category_hierarchy, start=1): - products = self.env['product.product'].search([ - ('public_categ_ids', '=', cat.id), - ('x_manufacture', '=', category.brand_id.id) - ]) - - if products: - print(f"Level {level} : {cat.name} {category.brand_id.x_name}") + for level, cat in enumerate(reversed(category_hierarchy), start=1): + print(f"Level {level}: {cat.name} {category.brand_id.x_name}") count += 1 - # if count == 5: - # break print(f"Total categories processed: {count}") # def _generate_url(self): |
