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

Why the t-if condition is not working 
what is the specific reson for it

code is in comment

الصورة الرمزية
إهمال
الكاتب

<xpath expr="//div[@name='company_address']" position="attributes">
<t t-if="o and o._name == 'purchase.order'">
<attribute name="class">col-5</attribute>
</t>
</xpath>

i want to customize the div class for specific report

أفضل إجابة

Hi,

Please try this below code


Hope it helps!

 

الصورة الرمزية
إهمال
الكاتب

not working
<div class="col-5 offset-1" name="company_address">
i want if o._name is puchase.order than class should be col-6 and in other cases class should be as it is i.e. col-5 offset-1

أفضل إجابة

Hi,
Can you try like this:


Thanks

الصورة الرمزية
إهمال
الكاتب

i do not want to add t-if in company_address
i check if the model is purchase.order (in qweb report) than i want to add class col-5 in company_address

<xpath expr="//div[@name='company_address']" position="attributes">
<attribute name="class">col-5" t-if="o and o._name == 'purchase.order'"</attribute>
</xpath>

الكاتب

<div class="col-5 offset-1" name="company_address">
i want if o._name is puchase.order than class should be col-6 and in other cases class should be as it is i.e. col-5 offset-1
not working since in both cases same class applied

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يناير 23
2470
1
نوفمبر 24
1595
0
أغسطس 24
1615
2
نوفمبر 23
3587
5
أغسطس 23
9835