Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4979 มุมมอง

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')
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
มิ.ย. 22
14859
0
มี.ค. 21
2235
0
พ.ค. 18
3221
Highlight Records in Tree แก้ไขแล้ว
3
พ.ค. 23
2217
1
มิ.ย. 21
3798