summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-18 09:09:07 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-18 09:09:07 +0700
commitd0af9ab71c65f6e7e1280b2978ebac2d0d514a45 (patch)
treee67c4e01cf08352ffd57a520fedbfc6d33788460
parent245f5c63c40527b94cf45e20e4c8dd15f5b51e98 (diff)
<iman> update generate tanpa chek product
-rw-r--r--indoteknik_custom/models/find_page.py12
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):