diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-11-30 13:02:48 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-11-30 13:06:16 +0100 |
| commit | 93d4db9d1e5ff7b1676b2f8a5392d8baf2afd79e (patch) | |
| tree | e7418d7d653332c2277b3d46f73c12375b423638 | |
| parent | 28463d031046f22460491fcf81788f93e4a395c3 (diff) | |
[FIX] product: resized variant images
This is possible to set an image for a specific variant
When this was the case, the image displayed was always the
image within its original size, it wasn't resized
to small and medium sizes.
opw-657055
| -rw-r--r-- | addons/product/product.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/product/product.py b/addons/product/product.py index b4db0ba4cae..7ac14c533ec 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -959,7 +959,12 @@ class product_product(osv.osv): def _get_image_variant(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, False) for obj in self.browse(cr, uid, ids, context=context): - result[obj.id] = obj.image_variant or getattr(obj.product_tmpl_id, name) + if context.get('bin_size'): + result[obj.id] = obj.image_variant + else: + result[obj.id] = tools.image_get_resized_images(obj.image_variant, avoid_resize_medium=True)[name] + if not result[obj.id]: + result[obj.id] = getattr(obj.product_tmpl_id, name) return result def _set_image_variant(self, cr, uid, id, name, value, args, context=None): |
