diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-05 09:26:51 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-05 09:26:51 +0700 |
| commit | 55a29fb33823733e486a24e6d5747b58d531294a (patch) | |
| tree | 5e6c2af03b4ac34cb783f79e45c8ae637fcd368f | |
| parent | 65f6e6ae297b535884c9563cfe1291f6c17157c9 (diff) | |
try solr image carousel
| -rw-r--r-- | indoteknik_custom/models/solr/product_template.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index 6c94efec..4b7139bd 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -85,8 +85,7 @@ class ProductTemplate(models.Model): cleaned_desc = BeautifulSoup(template.website_description or '', "html.parser").get_text() website_description = template.website_description if cleaned_desc else '' - carousel = [self.env['ir.attachment'].api_image('image.carousel', 'image', carousel.id) for carousel in template.image_carousel_lines] - + carousel_images = ', '.join([self.env['ir.attachment'].api_image('image.carousel', 'image', carousel.id) for carousel in template.image_carousel_lines]) document = solr_model.get_doc('product', template.id) document.update({ "id": template.id, @@ -96,7 +95,7 @@ class ProductTemplate(models.Model): "product_rating_f": template.virtual_rating, "product_id_i": template.id, "image_s": self.env['ir.attachment'].api_image('product.template', 'image_512', template.id), - "image_carousels": [self.env['ir.attachment'].api_image('image.carousel', 'image', carousel.id) for carousel in template.image_carousel_lines], + "image_carousels": carousel_images, 'image_mobile_s': self.env['ir.attachment'].api_image('product.template', 'image_256', template.id), "variant_total_i": template.product_variant_count, "stock_total_f": template.qty_stock_vendor, |
