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

how can I set a specific column's width in One2many field's tree view in odoo 13?

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

Hi,

Try giving style for the field as inline for the tree view of one2many field.

eg: 

<field name="name" width="100px"/>.


Hope it helps

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

Please goto one2many field tree and add custom class and define CSS, and use data-name of field to mapp 

I have done like this is . 


custom_size
.custom_size th.o_column_sortable[data-name="name"]{
width:300px !important;
max-width:300px !important;
}

i have use this for name column  or name field 


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

After a lot of searching I found a solution...I put it in my comments

อวตาร
ละทิ้ง

After a lot of searching I found a solution... with the width attribute with xpath:
<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
<attribute name="width" >170px</attribute>.
</xpath>

คำตอบที่ดีที่สุด

I don't think it is possible to simply set the width in tree view. I've tried but I couldn't. 

อวตาร
ละทิ้ง