تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2146 أدوات العرض

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
يونيو 23
4352
2
مايو 18
3787
1
أغسطس 23
3271
0
نوفمبر 21
2356
4
أكتوبر 21
80022