Search code examples
xmlformattingodoo

How to apply multiple formating on single field in xml odoo?


I want to apply formatting according to my field value if value in selection field is 'open', 'pending' and 'solved' colors should be 'red', 'blue' and 'grey' respectively.

<field name = 'status' widget="selection" attrs="{'invisible':[('type','=','open')]}" style="color:red;" />

Solution

  • <field name = 'status' widget="selection" decoration-danger="status=='open'" decoration-info="status=='pending'" decoration-muted="status=='solved'"/>
    

    It is working for me.