Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2138 Переглядів

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
4350
2
трав. 18
3782
1
серп. 23
3265
0
лист. 21
2355
4
жовт. 21
80020