Skip to content
Snippets Groups Projects
Commit 7daa85dd authored by Dharmraj Jhala's avatar Dharmraj Jhala Committed by Sébastien Theys
Browse files

[IMP] base,product,website_sale,*: improve product images


* = account, purchase, website_sale_comparison, website_sale_wishlist

Raw Image & Mixin
=================

Previously, the main image from a product was stored resized. This caused
inconsistencies with the size of the images on ecommerce: the main image was
resized, but the extra images were not.

Now, we always store all raw images, thanks to the new mixin. This way, product
images that were created before the installation of ecommerce will be ready to
be used in ecommerce without any other change.

We also store the resized versions instead of computing them on the fly: this
will take more disk space, but significantly increase the speed of the
pages when displaying images, as well as reduce server CPU load.

Images on variants
==================

Previously, it was only possible to set the extra product images on a template,
and not on a variant.

Now, we allow extra images also on the variants, this gives more flexibility to
the user.

Both extra images on template and variant have been given a sequence field to be
able to sort them easily.

On /shop we always display the image of the template for performance reasons.
On /product we never display the image of the template, unless the variant has
no image, then the template image is the fallback.

Carousel
========

The carousel view has been cleaned and improved:

- remove the duplicate XML that was created with the product configurator fix
- use a single loop from a single source to get all the images, instead of
	merging the different sources in the view with complex conditions
- improve the HTML structure, reduce the CSS with appropriate classes

Preview Image
=============

Both in website and backend: make better use of `preview_image` to display
a small image whenever possible, to reduce download size for the end user.

task-34045
PR: #30656

Co-authored-by: default avatarParth Gajjar <pga@odoo.com>
Co-authored-by: default avatarSébastien Theys <seb@odoo.com>
parent 413c6355
No related branches found
No related tags found
No related merge requests found
Showing
with 246 additions and 303 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment