I want to display the payment informations on my invoice Qweb, but these ones depend on the method of payment.
If the invoice is paid with factoring, I wanna display the text 1, if not, I wanna display the text 2.
So I created a boolean field "x_factoring" in invoice.form.
I want to write something like this :
<div if t-field="x_factoring == true">
<div if t-field="x_factoring == false">
I don't know the exact way to do so thanks to correct me.
maybe you could try t-if :)
Here a sample
<t t-set='x_field' t-value='bool(1)' />
Value : <t t-esc="x_field and 'TRUE' or 'FALSE'"/>
<div t-if="x_field">My div TRUE</div>
<div t-if="not x_field">My div FALSE</div>
<t t-set='x_field2' t-value='bool(0)'/>
Value : <t t-esc="x_field2 and 'TRUE 2' or 'FALSE 2'"/>
<div t-if="x_field2">My div TRUE 2</div>
<div t-if="not x_field2">My div FALSE 2</div>
Value : TRUE
My div TRUE
Value : FALSE 2
My div FALSE 2
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 6/15/16, 10:55 AM|
|Seen: 308 times|
|Last updated: 6/15/16, 11:29 AM|