跳至內容
選單
此問題已被標幟
1 回覆
2135 瀏覽次數

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!

相關帖文 回覆 瀏覽次數 活動
2
6月 23
4350
2
5月 18
3782
1
8月 23
3264
0
11月 21
2354
4
10月 21
80017