From 5e3e425902513c9a013f208c9e374ea322e516c3 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 31 Jan 2024 10:14:58 +0700 Subject: Add image on product variant --- indoteknik_custom/models/solr/product_template.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indoteknik_custom/models/solr/product_template.py') diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index bba98edc..062f1455 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -1,6 +1,7 @@ -from odoo import models, fields, api from datetime import datetime +from odoo import api, fields, models + class ProductTemplate(models.Model): _inherit = "product.template" @@ -70,7 +71,7 @@ class ProductTemplate(models.Model): "default_code_s": template.default_code or '', "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_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, "weight_f": template.weight, -- cgit v1.2.3