List views

At this point, list views should need little introduction, but we are still going to discuss the attributes that can be used with them. Here is an example of a list view for our To-Do Tasks:

<record id="view_tree_todo_task" 
  model="ir.ui.view"> 
  <field name="model">todo.task</field> 
  <field name="arch" type="xml"> 
    <tree decoration-muted="is_done" 
      decoration-bf="state=='open'" 
      delete="false"> 
      <field name="name"/> 
      <field name="user_id"/> 
      <field name="is_done"/>
      <field name="state" invisible="1"/>
    </tree> 
  </field> 
</record> 

The row text color and font can change dynamically depending on the results of a Python expression evaluation. This is done through decoration–NAME attributes, with the expression to evaluate based on field attributes. ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.