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

On odoo 16 if there are too many columns on tree view it does not auto adjust the width.

Is there any syntax or module which help to adjust the tree view columns?

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

Hi,

Try this code below to adjust the width,

th.o_column_sortable[data-name="field_name"]

width:150px !important; 

max-width:150px !important;

 } 


Hope it helps

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

Hi, 
define scss file in your module and add the following lines

.manual_entry_tree table.o_list_table thead th[data-name] {

  width: 150px !important;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}


.manual_entry_tree table.o_list_table tbody td[data-name] {
  width: 150px !important;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

then on your tree use class="manual_entry_tree"
make sure you have added the scss file in assets-> web.assets_backend

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

This solution worked for me.

This is how I used it:

I added a new class to the tree view (In my case, it was Description field in sale order lines)


order_line_tree


Used following scss

.order_line_tree > table > thead > tr > th.o_column_sortable[data-name='name']{
width:200px !important;
max-width:200px !important;
}


Thank you for the help :)

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

Thanks cybrosis, can you give more detailed information ?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
1624
1
เม.ย. 25
2749
1
เม.ย. 25
3511
1
เม.ย. 25
1091
2
ก.พ. 25
1947