Odoo Help


What is the correct syntax for an "if" request ?

Anne-Sylvie Burri
on 9/23/13, 7:20 AM 511 views

Hi everybody,

I'm trying to add an "if" request in my invoice report but I can't find the correct syntax.

I just wanna make a text appear if a boolean field is "True". If this field isn't check, then no text appear.

Now my code is the following :

[[ (o.materiel=='True') and 'Réserve de propriété...' ]]

Someone could help me ?

Many thanks in advance.



Andreas Brueckl

--Andreas Brueckl--
Andreas Brueckl
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 9/23/13, 7:25 AM

Try this:

   <para>[[ o.materiel and 'Réserve de propriété...' or removeParentNode('para') ]]</para>

Thanks for your answer. I just tried this but it doesn't work, nothing appear.

J.-M. Burri - Bureau ing.-conseils informatique, Anne-Sylvie Burri
on 9/23/13, 7:30 AM

Sorry it works ! I just made a little mistake when I have written your code.

J.-M. Burri - Bureau ing.-conseils informatique, Anne-Sylvie Burri
on 9/23/13, 7:39 AM

Your Answer

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

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/23/13, 7:20 AM
Seen: 511 times
Last updated: 3/16/15, 8:10 AM