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

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.




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

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Great, thanks for the explanation!

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 6 23
4350
2
thg 5 18
3782
1
thg 8 23
3265
0
thg 11 21
2355
4
thg 10 21
80020