Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4972 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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')
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 6 22
14852
0
thg 3 21
2229
0
thg 5 18
3217
3
thg 5 23
2216
1
thg 6 21
3794