Skip to Content
Menu
This question has been flagged
2 Replies
6921 Views

Hello everybody,

Odoo doesn't consider the second condition in which I use the first condition.
The lines only take orange color,  although to have red color is true.
That is my xml code:

<tree position="attributes">
<attribute name="colors">orange:state=='ready';green:state=='released';red:state
in ('ready','released') and date &gt; current_date
    </attribute>
</tree>

Can you help me?
Best regards.


Avatar
Discard
Best Answer

Hi,

You have to change the order of your statements. Odoo take the first returns true.

So, if your first condition is more global then the others, odoo will always take it and ignore the rest.

<tree position="attributes">

        <attribute name="colors">

                red:state in ('ready','released') and date &gt; current_date;

                orange:state=='ready';

                green:state=='released'

        </attribute>

</tree>

Best regards.

Avatar
Discard