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

I'm trying to inherit a report template and hide a div element with a date. I achieved it using a t-if attribute but if I try to use invisible attribute is not working. Any idea why is this happening?

<xpath expr="//div[@name='div_sched_date']" position="attributes">
<attribute name="invisible">o.state == 'waiting' /attribute> NOT WORKING
   <attribute name="attrs"> {'invisible': [['o.state','==','En Espera']]} /attribute> NOT WORKING
​<attribute name="t-if">o.state in ('confirmed', 'shipped', 'done') /attribute> WORKING
</xpath>

Thanks a lot.




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

Hello this is not like xml view for model, it is a report template (qweb) so the you can not use "invisible" or "attrs". If you want to invisible an element base on a codition, use t-if is the correct way

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

Great, thanks for the explanation!

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 23
4337
2
พ.ค. 18
3780
1
ส.ค. 23
3256
0
พ.ย. 21
2351
Attrs multiple condition. Boolean AND. แก้ไขแล้ว
4
ต.ค. 21
79993