How to add colors to tree view in odoo ?
06/January/2018
It's an awesome feature of Odoo to color tree views. For that we can use tree view attribute colors.
Xml Syntax.
<tree colors="your_color:field== 'value'">
Example
<tree colors="grey:state == 'cancel'">
How to add colors to tree view in odoo 11 ?
For version 9, colors are replaced by the decorators. However it will support up to version 10.
But Odoo 11th version support decorators only.
The possible decorators are
decoration-bf - shows the line in BOLD
decoration-it - shows the line in ITALICS
decoration-danger - shows the line in LIGHT RED
decoration-info - shows the line in LIGHT BLUE
decoration-muted - shows the line in LIGHT GRAY
decoration-primary - shows the line in LIGHT PURPLE
decoration-success - shows the line in LIGHT GREEN
decoration-warning - shows the line in LIGHT BROWN
decoration-it - shows the line in ITALICS
decoration-danger - shows the line in LIGHT RED
decoration-info - shows the line in LIGHT BLUE
decoration-muted - shows the line in LIGHT GRAY
decoration-primary - shows the line in LIGHT PURPLE
decoration-success - shows the line in LIGHT GREEN
decoration-warning - shows the line in LIGHT BROWN
Syntax
<tree decoration-type="field=='value'">
Example
<tree decoration-success="state=='done'">
Preview of decorators
This formatting is dependent on the bootstrap style.
hope this will help you !
Recent Posts
How to show images in qweb (odoo 11) ?
15 Apr 2018
What is Odoo Database Management ?
10 Apr 2018
Online Marketing Company Saudi Arabia
04 Apr 2018
ERP Implementation Saudi Arabia
27 Mar 2018
Participate on our social stream.