Skip to Content
Menu
This question has been flagged
1 Reply
8415 Views

Please help on this issue, thanks in advance!

A) What I am looking for:

change column width in tree view of a wizard in Odoo 13, rather than default width setting because one column in my wizard is quite wide

B) What I saw:

1) by default, the column of product name is quite wide

2) I tried the solution " The workaround I found " on https://www.odoo.com/es_ES/forum/ayuda-1/changing-column-widths-tree-view-35981  (recommended by https : //www.odoo.com/fr_FR/forum/aide-1/how-to-change-column-width-in-tree-view-one2many-many2many-26693 ), but it still does not work.
btw, I am sure that the css file was loaded well because I defined another css class in the same file and it worked.

C) What I did (reproducing steps):

 1) the tree view (unable to show <>, use # instead):
#tree editable = "bottom" create = "false" delete = "false" class = "o_my_class" #
#field name = "display_name" readonly = " 1 "/ #
#field name =" qty_1 "readonly =" 1 "/ #
# / tree #

2) css definition:
.o_my_class [data-id =" display_name "] {width: 10px; color: red; }

Avatar
Discard
Best Answer

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/


Avatar
Discard