odooodoo-8openerp-8

Multiple Colors in Odoo Tree View


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!!


Solution

  • 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**