Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
292 Zobrazení

Hi there. I have this field in a list view. My goal is to have a fixed width for this column, so the image will not be cut if more fields are added to the list view.

<field name="image_1920" width="120px;" string="Image" widget="image" readonly="1" optional="show"/>

Now I am getting this error when opening the view: 

Odoo Client Error

UncaughtPromiseError > OwlError

Uncaught Promise > Invalid props for component 'ImageField': 'width' is not a number

Occured on localhost:8069 on 2025-08-02 15:36:41 GMT


Can anybody help? The weird thing is, it worked at first, but after a while I got the error. I removed it, changed it to the options attribute (works with resize, but gets cut off when more fields are added), then changed it back to width. Then it worked again for a while, now I get the error again. I have never seen such a behaviour.


Thank you.

Avatar
Zrušit
Nejlepší odpověď

Hii,

in odoo owl the width parameter for an image field must be passed as a number , not as a css string like 120 px

here is example 

<tree>

​<field name="name"/>

​<field name="image_1920" width="120" string="Image" widget="image" />

</tree>


i hope it is usefull

Avatar
Zrušit