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

Hellp my friends;

I am using in the tree view of my class the color attribute.

So, i want to color my tree red for example when a field is like a specific character.

Here is what i heve tried but does not work:

mail_subject not like '%urgent%'

Can anyone help please.

Best regards.

形象
丢弃
最佳答案

Hi you need just about

<tree string="Tabel List"  colors="green:check_empty == 1; red:check_empty == 0"  >
...
<field name="check_empty" string="empty" invisible="True"/>
...
</tree>

In models  about

@api.one 
def _check_tabel (self):
if self.mail_subject.find('urgent', 0, len(self.mail_subject) ) >=0:
self.check_empty = 1
else
self.check_empty = 0

check_empty = fields.Integer(string="check empty or nochange",compute='_check_tabel')
形象
丢弃
相关帖文 回复 查看 活动
4
6月 22
14802
0
3月 21
2180
0
5月 18
3156
3
5月 23
2164
1
6月 21
3739