Search code examples
javascriptodooodoo-14

How can I unshrink column headers of one2many tree view in odoo 14?


Odoo shrinks the column header based on datatypes and when there are many fields in one2many tree view. the columns are shrinked.

When I checked the file list_editable_renderer.js under web folder There are these constants for column width

 const fixedWidths = {
            boolean: '70px',
            date: '92px',
            datetime: '146px',
            float: '92px',
            integer: '74px',
            monetary: '104px',
        };

I am just not able to solve this issue.

One2many

I tried changing few of the JS code, None seem to be working. Any help or guidance would be of a great help


Solution

  • You can add a custom CSS to set the minimum width for those fields. You can set a class attribute on the tree view then, in CSS, use that class to target the tree and use the data-name attribute to target a specif field.

    By default, min-width is set to 74px, use !important to force the new value.

    To show Customer length label, try length of 130px.

    Example:

    .ef_saletree th[data-name="x_customer_order_length"]{min-width: 130px !important;}