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

There is a way to change the width of a column in a tree view?

อวตาร
ละทิ้ง

Have you tried that : <field name="name" width="100"/> with the size you want in width ?

@Felipe, is the issue solved?? I am also facing the same problem here... provide me the detail

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

You can do that with css. First you need to add your own css stylesheet (check help.openerp.com/question/5783/how-to-add-a-custom-css/ on how to do that)

Then, inside your css, you can select your desired column with css attribute selector (www.w3.org/TR/selectors/#attribute-selectors) just like that:

[data-id="name"] {
    width: 200px;
}

Of course, you need to fine-grain your selections.

อวตาร
ละทิ้ง

I don't believe custom css works in tree view. Can anyone confirm this?

tim: got it working?

thanks mate... normal classes didn't work and I was loosing hope that this is even possible.

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

The answer of Pedro JPG Work in odoo V16




Is Working

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

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>

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

What works for me in v14 is doing it like this: style="width: 50px !important;"

But this only works on one2many or many2many field in form view.

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

See this link https://www.odoo.com/forum/help-1/question/changing-column-widths-tree-view-35981

อวตาร
ละทิ้ง

thanks

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
เม.ย. 25
4774
Create dynamic tree view แก้ไขแล้ว
3
ก.ย. 23
9551
1
ก.ย. 22
3808
1
มิ.ย. 22
12635
3
มี.ค. 20
11115