diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-09 15:52:03 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-09 15:52:03 +0700 |
| commit | 4e54d00cf34d262ffa477d8267fb33682c98e649 (patch) | |
| tree | 8b82317e25ddf32120f3776f84535edf6e56b63a | |
| parent | ba871e1ff11e160823e3c816c707b642eedea200 (diff) | |
Fix product variant image
| -rw-r--r-- | indoteknik_custom/models/solr/product_product.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py index ac41dbff..5a74df8c 100644 --- a/indoteknik_custom/models/solr/product_product.py +++ b/indoteknik_custom/models/solr/product_product.py @@ -49,12 +49,6 @@ class ProductProduct(models.Model): document = solr_model.get_doc('variants', variant.id) - image = '' - if variant.image_256: - image = ir_attachment.api_image('product.product', 'image_256', variant.id) - else: - image = ir_attachment.api_image('product.template', 'image_256', variant.product_tmpl_id.id) - document.update({ 'id': variant.id, 'display_name_s': variant.display_name, @@ -63,7 +57,7 @@ class ProductProduct(models.Model): 'product_rating_f': variant.product_tmpl_id.virtual_rating, 'product_id_i': variant.id, 'template_id_i': variant.product_tmpl_id.id, - "image_s": image, + 'image_s': ir_attachment.api_image('product.template', 'image_256', variant.product_tmpl_id.id), 'stock_total_f': variant.qty_stock_vendor, 'weight_f': variant.product_tmpl_id.weight, 'manufacture_id_i': variant.product_tmpl_id.x_manufacture.id or 0, |
