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

 I would like to use t-if condition to check whether a field name (Ex.: 'Total Value') contains a string '**Total**'. I tried using:

t-if = 'Total' in a.name but it seems to check whether a.name is equal to 'Total'. 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Try it like this, it normally works

<t t-if="'Total' in a.name">

อวตาร
ละทิ้ง
ผู้เขียน

It works, thanks :)

คำตอบที่ดีที่สุด

<t t-if="'Total' in a.name">

Correct me,If I am wrong
 Thank you


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

My guess is that it should probably be unicode:

<t t-if="u'Total' in a.name">
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 18
3429
0
ก.พ. 18
3330
1
ก.ค. 25
1734
1
พ.ค. 25
1741
QWeb: use t-if to check birthday date แก้ไขแล้ว
1
เม.ย. 25
2300