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 book_view.xml:
The <field> elements define fields that are also searched when typing in the search box. We added publisher_id to automatically suggest searching in the publisher field. The <filter> elements add predefined filter conditions, which can be toggled with a user click, are defined using a specific syntax. This will be addressed in more detail in Chapter 10, Backend Views – Design the User Interface.
Changed in Odoo 12 <filter> elements are now required to have a name="..." attribute, uniquely identifying each filter definition. If missing, the XML validation will fail and the module will not install or upgrade.