Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1471 Zobrazení

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

code is in comment

Avatar
Zrušit
Autor

<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

Nejlepší odpověď

Hi,

Please try this below code


Hope it helps!

 

Avatar
Zrušit
Autor

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

Nejlepší odpověď

Hi,
Can you try like this:


Thanks

Avatar
Zrušit
Autor

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>

Autor

<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

Related Posts Odpovědi Zobrazení Aktivita
1
led 23
2442
1
lis 24
1554
0
srp 24
1601
2
lis 23
3569
5
srp 23
9819