From eb5d95b135473787f9133f65c244aa9e3d2e0036 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 30 Nov 2015 13:46:33 +0100 Subject: [PATCH] [FIX] product: _get_image_variant is used for the field `image` This revision is related to 93d4db9d1e5ff7b1676b2f8a5392d8baf2afd79e. Usually, for models with an image, the original `image` is stored in the field `image`, and then the resized value are in the fields `image_medium` & `image_small`. In the specific case of the product variant, this is not the case, the original image is stored in the field `image_variant`, and the `image` field uses as well the method `_get_image_variant`. The `image_get_resized_images` must therefore return the "big image" as well, which is returned with the key `image`, by default. This is done using the method argument `return_big`. --- addons/product/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index 7ac14c533ec..29a7de0cbab 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -962,7 +962,7 @@ class product_product(osv.osv): 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] + result[obj.id] = tools.image_get_resized_images(obj.image_variant, return_big=True, avoid_resize_medium=True)[name] if not result[obj.id]: result[obj.id] = getattr(obj.product_tmpl_id, name) return result