Skip to Content
Menu
This question has been flagged
1 Reply
2071 Views

i need to add some multiple colors to odoo tree view based its state value i tried builtin decorations but it contains only few colors please help me in this.

Avatar
Discard
Best Answer

Hello paidy kumar,

Hope you are doing well.

You have to download the OCA module "Colorize field in tree views" (https://odoo-community.org/shop/product/colorize-field-in-tree-views-2814#attr=11029) and installed it into your odoo version. Then you have to write the code below in your tree view:

see comment :





Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari 

Avatar
Discard

<tree>
<field name="name" options='{"bg_color": "red: is_state == True(Here you write the condition based on states.)"}'/>
<field name="is_state"/>
</tree>

Author

thanks for your answer sir .this is for column wise coloring..i need row color same like decorators functionality

Hello paidy kumar,

Hope you are doing well.

If you want row wise coloring then you need to write "options='{"bg_color": "red: is_state == True(Here you write the condition based on states.)"}" into all the fields of tree view in xml file.