This question has been flagged
2 Replies
4478 Views


how to differentiate rows by color code based on a condition?

Avatar
Discard
Best Answer

these links could help you to do that

http://stackoverflow.com/questions/25699625/how-to-color-a-field-in-tree-view-with-today-as-filter

https://www.odoo.com/forum/help-1/question/change-tree-color-with-field-function-17133

https://www.odoo.com/forum/help-1/question/how-to-add-css-to-any-row-in-a-tree-view-based-on-a-condition-51015

Avatar
Discard
Best Answer

Here is example of how you can set colors and fonts in tree view


<record id="todo_app.view_tree_todo_task" model="ir.ui.view">
  <field name="name">To-do Task Tree</field>
  <field name="model">todo.task</field>
  <field name="arch" type="xml">
    <tree editable="bottom"colors="gray:is_done==True" fonts="italic: state!='open'" delete="false">
      <field name="name"/>
      <field name="user_id"/>
    </tree>
   </field>
</record>


Cheers

Avatar
Discard