Skip to content
Snippets Groups Projects
Commit 74a79ce6 authored by Romain Derie's avatar Romain Derie
Browse files

[FIX] web_editor: avoid fetching optimized images which can't be shown


Before this commit, when opening the media dialog, the optimized images
would be fetched too.
An optimized image is an image related to an original one which received
some modification (crop etc).
Those optimized images are hidden by default, and can only be shown when
toggling the "Show optimized" option, which can be shown only in debug
mode.

So, fetching those images outside debug mode is:
1. Useless, as we don't do anything with those and never show them
2. Buggy sometimes, as a full patch of "Load more" images could be
   composed of only optimized images, meaning the "load more" will
   actually look like it did nothing, as all received images are (and
   will remain) hidden.

There is a tiny exception: if the edited image is an optimized one, we
still need to fetch it's attachment so we can show this image in the
media dialog as selected.

This fix thus filter out all the optimized images (except the one from
the explained exception) from the `search_read()`.

opw-3372811

closes odoo/odoo#126817

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent ab0ae8da
No related branches found
No related tags found
No related merge requests found
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