Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
10806 Lượt xem

Hello,

Im trying to increase (or decrease) the width of the column in tree view of Odoo 13.

I'd tried like this:

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

But it not work.

I also tried with CSS by following the link 

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

But it still not work, or what am I doing wrong?

Please help!

Thank you!


Ảnh đại diện
Huỷ bỏ

any solution yet? 

Câu trả lời hay nhất

Hello,

1) Add a class to your tree:

my_class

2) Create a scss file like:
.custom_column [data-name="product_id"]{
width: 400px !important;
max-width: 400px !important;
}
*with data-name is the name of your column
3) Add the scss file to your assets:

4) Then add the assets file to your _manifest_.py data :

'data': [
'views/assets.xml',
],

Best regards,

Imal-Tech team

Contact@imal-tech.com

https://imal-tech.com/


Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you Imal-Tech team. I'd followed your solution. I'm using Odoo 15 Community now. So I add the scss file into __manifest__.py directly. But it still does not work for me. Please help!. Thank you!

Thanks for the solution

Any idea on how to change all columns width ?

Thank you in advance

Câu trả lời hay nhất

try width="100px" instead

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
1536
11
thg 10 24
99860
1
thg 7 25
2527
1
thg 12 24
4152
0
thg 5 23
2293