Odoo Help


Attrs colors blue if more than 10 and less 50 [Closed]

Dr Obx
on 5/31/15, 6:39 PM 1,203 views

The Question has been closed for reason: not relevant or out dated

Dr Obx
on 06/01/2015 09:32:35

Hi guys, I would like to do something like change colors: red if quantity is less than 10, blue: more than 10 but less than 25 and other color if more than 25.

Can i do it like that:

attrs="{'colors',(red: 'qty_available','<',10;blue: 'qty_available','>',10,'or','<',25; green: 'qty_available','>',25;)}"

If not ... how ?

On 6/1/15, 8:48 AM

You can try:

<tree colors="red: qty_available < 10; blue: qty_available >= 10 and qty_available <= 25; green: qty_available > 25">

Maybe you have to change the "<", ">=", "<=" and ">" by the html entities "&lt;", "&ge;", "&le;"  and "&gt;"

Thank you Quentin, works beautifully :) colors="red: qty_available <10; blue: qty_available >= 10 and qty_available <= 25; green: qty_available > 25"

Dr Obx
on 6/1/15, 9:20 AM

Now I understand how it works so it's simple. :) Thank you

Dr Obx
on 6/9/15, 8:13 AM
Mansi Kariya (mka)
On 6/1/15, 5:53 AM

Hi Rob,

Here is an example for you.

<tree colors="red:total_difference<0.1;blue:total_difference>=0.1" string="Period">

Hope this will help you.

Excellent but i'm not interested in '' form but attrs="{'colors',(red: 'qty_available','',10,'or','',25;)}" especially how can i set the range if I would like to set more than 2 colors ... :) so example: red: 'qty_available',,20 and ,

Dr Obx
on 6/1/15, 7:43 AM

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

1 follower(s)


Asked: 5/31/15, 6:39 PM
Seen: 1203 times
Last updated: 6/1/15, 9:45 AM