Skip to content
Snippets Groups Projects
Commit c1d7eab2 authored by Julien (jula)'s avatar Julien (jula)
Browse files

[FIX] tools: image fields size guess (backport)

Backport: https://github.com/odoo/odoo/pull/117343



__Current behavior before PR:__
The size of an image field is guessed using the field name. For instance, an image field with `field_name = "XXXX_123"` is resized to 123 pixels when fetched. This is can be an issue if a user creates an image field using studio in a form view. If the user sets the label of the field as "Image 1", the technical name will become `x_studio_image_1`. Therefore, the image field will be resized to 1 pixel width.

Note that in version anterior to 16, only the placeholder is resized since `image_guess_size_from_field_name` is never called when there is an actual image.

__Description of the fix:__
Refactor the `image_guess_size_from_field_name` method to return `(0, 0)` when the field name starts with `x_`.

closes odoo/odoo#118932

Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
parent 1a3877f7
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