跳至内容
菜单
此问题已终结
2 回复
4927 查看

I would like to change the color of the label/string and the value of the field in kanban view whenever the priority id field changes its value(VIP, HIGH, LOW, etc.) and i want to assign different color for each value..Thank very much in advance.

形象
丢弃
最佳答案

In Odoo 14 you have to set it to a div around the field to color it.

<div t-attf-class="text-danger">
​<field name="field_name" attrs="{'invisible': [('other_field', '=', False)]}"/>
div>


And you can make it conditional:

<div t-attf-class="#{record.value > 3 and 'danger' or 'warning'}">
​<field name="field_name" />
div>
形象
丢弃
相关帖文 回复 查看 活动
12
10月 23
36019
0
3月 15
4953
4
3月 15
5121
2
3月 15
6221
4
3月 15
5052