List views
After having spent quite some time on the form view, we'll now have a quick look at how to define list views. Internally, they are called tree views in some places and list views in others, but, given there is another construction within the Odoo view framework called tree, we'll stick to the wording list here.
How to do it...
Define your list view:
<record id="tree_all_customers" model="ir.ui.view"> <field name="model">res.partner</field> <field name="arch" type="xml"> <tree colors="blue: customer and supplier; green:customer; red: supplier"> <field name="name" /> <field name="customer" invisible="1" /> <field name="supplier" invisible="1" /> </tree> </field> </record>
Tell the action from the first recipe to use it:
<record id="action_all_customers_tree" model="ir.actions.act_window.view"> <field...