[FIX] product: _get_image_variant is used for the field `image`
This revision is related to 93d4db9d1e
.
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`.
This commit is contained in:
parent
44248a07a5
commit
eb5d95b135
|
@ -962,7 +962,7 @@ class product_product(osv.osv):
|
||||||
if context.get('bin_size'):
|
if context.get('bin_size'):
|
||||||
result[obj.id] = obj.image_variant
|
result[obj.id] = obj.image_variant
|
||||||
else:
|
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]:
|
if not result[obj.id]:
|
||||||
result[obj.id] = getattr(obj.product_tmpl_id, name)
|
result[obj.id] = getattr(obj.product_tmpl_id, name)
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue