简体   繁体   English

如何在odoo 14中取消缩小one2many树视图的列标题?

[英]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. Odoo 根据数据类型以及在 one2many 树视图中有许多字段时缩小列标题。 the columns are shrinked.列被缩小。

When I checked the file list_editable_renderer.js under web folder There are these constants for column width当我检查 web 文件夹下的文件 list_editable_renderer.js 时,列宽有这些常量

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

I am just not able to solve this issue.我只是无法解决这个问题。

一对多

I tried changing few of the JS code, None seem to be working.我尝试更改一些 JS 代码,但似乎都没有工作。 Any help or guidance would be of a great help任何帮助或指导都会有很大帮助

You can add a custom CSS to set the minimum width for those fields.您可以添加自定义 CSS 来设置这些字段的最小宽度。 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.您可以在树视图上设置一个类属性,然后在 CSS 中使用该类来定位树,并使用data-name属性来定位特定字段。

By default, min-width is set to 74px , use !important to force the new value.默认情况下, min-width设置为74px ,使用!important强制使用新值。

To show Customer length label, try length of 130px .要显示Customer length标签,请尝试使用130px长度。

Example:例子:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM