Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
2144 Ansichten

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.




Avatar
Verwerfen
Beste Antwort

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

Avatar
Verwerfen
Autor

Great, thanks for the explanation!

Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juni 23
4351
2
Mai 18
3787
1
Aug. 23
3271
0
Nov. 21
2356
4
Okt. 21
80022