3
votes

Good Day! I just want to have a multiple color in tree view in Odoo, This will show if a Record state == approved colors is blue state == post colors is red

Right now I only have a one color in Approved State. Many Thanks for the Help!!

2
If I want to do this on M2O field then how to do that ?Keval Mehta

2 Answers

5
votes

hi dear please see this link and use attribute colors

link 2

Example

 <record id="view_model_tree" model="ir.ui.view">
                <field name="name">model_tree</field>
                <field name="model">model name</field>
                <field name="arch" type="xml">
                    <tree colors="blue:state == 'draft';gray:state in ('cancel','done');black:state == 'open'" >
                        <field name="state"/>
                    </tree>
                </field>
            </record>

Now you can use in v10 and v11,

<tree decoration-info="template_stage_id==eco_stage_id"> <field name="template_stage_id"/> <field name="eco_stage_id" /> 
</tree> 

and you can use more attribute like :

**decoration-muted** 

**decoration-dange**
0
votes

This will work, try this,

<tree colors="blue:state == 'approved';red:state == 'post'">
   <field name="state"/>
</tree>