Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 6/15/16, 10:55 AM|
|Seen: 798 times|
|Last updated: 6/15/16, 11:29 AM|