New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master image india seb #30656

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@seb-odoo
Copy link
Contributor

seb-odoo commented Jan 29, 2019

rebase-ff

todo:

  • maybe: make the mixing in base instead of product?
  • drag and drop kanban (depends on task-190280, can be added later if lacking time)
  • add tests (can be added later if lacking time)
  • new task: never resize square, keep aspect ratio
  • new task: use mixin for every model with images
  • squash (some of) the commits (when it's ready)
  • fix click on carousel preview
  • fix web/ backend image test
  • test with a lot of images
  • fix bug with main image not removable
  • prevent big resize if original too small

@seb-odoo seb-odoo self-assigned this Jan 29, 2019

@robodoo robodoo added the seen 🙂 label Jan 29, 2019

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch 4 times, most recently Jan 29, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Jan 29, 2019

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch Jan 30, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Jan 30, 2019

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch 8 times, most recently Jan 30, 2019

@robodoo robodoo added the CI 🤖 label Feb 1, 2019

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch Feb 1, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Feb 1, 2019

@seb-odoo seb-odoo referenced this pull request Feb 1, 2019

Closed

Master product image seb #29653

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch Feb 4, 2019

@robodoo robodoo removed the CI 🤖 label Feb 4, 2019

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch 2 times, most recently Feb 4, 2019

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch from 35b5ddc to 9b454a0 Feb 14, 2019

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 14, 2019

[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: odoo#30656

Co-authored-by: Parth Gajjar <pga@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
[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: Parth Gajjar <pga@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>

@seb-odoo seb-odoo force-pushed the odoo-dev:master-image-india-seb branch from 9b454a0 to 8f1fcf1 Feb 14, 2019

@JKE-be

This comment has been minimized.

Copy link
Contributor

JKE-be commented Feb 14, 2019

@robodoo r+ rebase-ff

@robodoo robodoo added the r+ 👌 label Feb 14, 2019

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Feb 14, 2019

Merge method set to rebase and fast-forward

@robodoo robodoo added the CI 🤖 label Feb 14, 2019

robodoo pushed a commit that referenced this pull request Feb 14, 2019

[IMP] web: allow preview_image option for image widget of qweb field
With this option we can define which field is going to be displayed by the qweb
image widget, while logic is still applied to the original field.

For example, we want to show a thumbnail image but when user updates it with the
web editor, we want to update the actual field instead of the thumbnail field.

This is similar to the preview_image of the JS image widget.

task-34045
PR: #30656

robodoo pushed a commit that referenced this pull request Feb 14, 2019

[IMP] tools,base,web: improve image tools
Add support for a 256*256 image, to be used in the following commit.

Define sizes in named variables instead of being hard-coded in several places in
the code.

Allow parameters `preserve_aspect_ratio` and `upper_limit` to be passed from
the different helper methods.

Factorize the code inside `image_resize_images` to make it easier to read.

Add new function to compute whether the size of an image is above a given size.

task-34045
PR: #30656

robodoo pushed a commit that referenced this pull request Feb 14, 2019

[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: Parth Gajjar <pga@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Feb 14, 2019

Merged, thanks!

@robodoo robodoo closed this Feb 14, 2019

@seb-odoo seb-odoo deleted the odoo-dev:master-image-india-seb branch Feb 15, 2019

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commits:
413c635
7daa85d

The tests in this PR achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: #

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

seb-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR odoo#30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: odoo#31181

robodoo pushed a commit that referenced this pull request Feb 18, 2019

[IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR #30656 which added the following commit:
7daa85d

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: #31181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment