When viewing a model in list mode, a <tree> view is used. Tree views are capable of displaying lines organized in hierarchies, but most of the time they are used to display plain lists.
We can add the following <tree> view definition to todo_view.xml:
<record id="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 colors="decoration-muted:is_done==True"> <field name="name"/> <field name="is_done"/> </tree> </field> </record>
This defines a list with only two columns: name and is_done. We also added a nice touch: the lines for done tasks (is_done==True) are shown as grayed out. This is done by applying ...