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.
hi, I am creating a RML report where in the table if a condition is satisfied then i want show image1 in a particular cell otherwise i want to show image2 in that cell how can i achieve this? i Have tried as <illustration height="8.0" width="10.0">[[ ( o.gender == "Male") ]] <image x="0" y="0" file="100000000000000C0000000B92165A49.png" height="8.0" width="10.0"/> </illustration> but without checking condition it is showing the image. so how can i write if and else in a cell of the Table? any kind of help is highly appreciated. Thanks
I think your scenario not only acheived using if and else clause but also we can use
and and or to acheive it. So that you can write like
cond and image1 or image2 so if condition is True it will result to image1 else it will result to image2.
And also you can use setTag python function in rml file between [[ ]] to set the attributes of the parent tag.
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.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: 2/2/14, 2:52 PM|
|Seen: 2683 times|
|Last updated: 3/16/15, 8:10 AM|