Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to adjust column widths in tree views in Odoo 10?

I wanted to change the column width of the columns in tree view. So far I have tried these solutions

  1. Adding in the field tag: width="100px" or width="15%%"

  2. Adding in the field tag: style="width: 100px"

But Nothing seems to work for me.

like image 927
Vaibhav Bhavsar Avatar asked Nov 19 '16 11:11

Vaibhav Bhavsar


1 Answers

I also looking for the same question, but seems like "style" doesn't work on tree view in Odoo. Seems like the only way is to define your own css class put the fixed width then assign the class on your field in your tree view.

Check this out:

xml

<tree string="Tree String" class="my_class">
    <field name="my_field" />
</tree>

css

.my_class [data-id="my_field"] {
    width: 1000px;
}
like image 163
Stone Avatar answered Oct 18 '22 12:10

Stone