Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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...

  1. 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>
  2. Tell the action from the first recipe to use it:

    <record id="action_all_customers_tree" model="ir.actions.act_window.view">
        <field...