Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
721 มุมมอง

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.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hi there, this does not work. I solved it using the options attribute, like this: 

<field name="image_1920" options="{'size': [0, 120]}"
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please refer to the following links:


Solved Forum:

1. https://www.odoo.com/sl_SI/forum/pomoc-1/changing-column-widths-tree-view-35981

2. https://www.odoo.com/sl_SI/forum/pomoc-1/column-width-on-list-view-180744


Video: https://www.youtube.com/watch?v=U3xbtQJef0w


Hope it helps.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง