Building a List View in Odoo

A list view shows many records together. How a developer builds one.

Where a form view shows one record, a list view shows many. This piece is about building a list view in Odoo.

What a list view is

A list view presents many records of a kind together, as a list: a row for each record, columns showing chosen fields. Where a form view is for working with one record in detail, a list view is for seeing many records at once, getting an overview, finding a record, comparing records. For a kind of record, the list view and the form view together cover the two ways records are genuinely seen: many at once, and one in detail.

Building a list view

A list view, in Odoo, is defined in XML, in a module's views, like a form view. The developer builds the list view by defining, in XML, how the records are presented as a list: which fields appear as the columns, the structure of the list. Building the list view is writing that XML definition of how the kind of record is presented in list form. The list view is built for a particular model, presenting that model's records.

Building a good list view

Building a good list view is about making the list a genuinely useful overview of the records. The key decision is which fields to show as columns: a list view shows a chosen set of the record's fields, and a good list view shows the fields that genuinely matter for seeing records at a glance, the fields that genuinely help a user understand and find records in the list. Show too few, and the list does not tell the user enough; show too many, and the list is cluttered. A good list view shows the genuinely useful fields, so the list is a clear, useful overview. Building a good list view means choosing those columns well.

The list view and the form view together

An honest point. The list view and the form view work together as the two main ways a kind of record is seen. The list view gives the overview of many records; from it, a user goes to a record's form view to see and work with it in detail. So building the views for a kind of record means building both: the list view for the overview, the form view for the detail. A developer building functionality for a kind of record builds the model, then the views, the list and the form, that present it. The two together are how the kind of record is genuinely seen and worked with.

Build it the Odoo way

Building a list view, like all Odoo development, should be done the Odoo way: list views have an established way they are defined, the XML structure and conventions, and a list view built that way works properly within the framework and is maintainable. A developer building a list view should do it within Odoo's conventions. Following the established way is part of building the list view well.

The takeaway

Building a list view in Odoo defines how many records of a kind are presented together as a list, done in XML, in a module's views, with chosen fields as the columns. A list view is for seeing many records at once, an overview, where a form view is for one record in detail. Build a good list view by choosing as columns the fields that genuinely help a user see and find records, so the list is a clear, useful overview. The list view and form view together are how a kind of record is seen, and the list view should be built the Odoo way. For how we approach Odoo, see our ERP practice.

All posts

Got a Topic Worth Posting?

Suggest a Topic

If a question keeps coming up in your operations, it might be worth its own post.