Hi,
I want to write a simple comparison expression in qweb (if age<16 then do something). But unfortunately, i can't use a smaller symbol "<".
<t t-if="student.age < 16">
do something .......
</t>
Please help!!!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I want to write a simple comparison expression in qweb (if age<16 then do something). But unfortunately, i can't use a smaller symbol "<".
<t t-if="student.age < 16">
do something .......
</t>
Please help!!!
XML has just five special characters, all they has corresponding codes:
< (<), & (&), > (>), " ("), and ' (').
you've to use < xml code of <, from above list:
<t t-if="student.age < 16">
do something .......
</t>
Quite strange though, I can use the normal characters without encoding them. I know its best practice to encode so but still strange that this doesn't work for thavorac.
maybe it works without encoding in some cases. I tried once to use in odoo domain statement in XML a & symbol as AND operator, it doesn't worked, then reverted back to encoded version: & amp ; and it started working. since I'm using only encoded versions of these 5 characters, to be sure...
Guess I'll always use encoding from now on then!
You may need to use &lt; instead of <
A similar expression for other special characters.
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ก.ค. 25
|
2559 | ||
|
1
พ.ค. 25
|
3104 | ||
QWeb: use t-if to check birthday date
แก้ไขแล้ว
|
|
1
เม.ย. 25
|
2970 | |
|
1
ก.พ. 25
|
2268 | ||
|
0
ต.ค. 24
|
1914 |