Odoo modules owe their existence to views, be it a list, form, or kanban view – all of them are XML that will be made clickable by the web client. In Odoo 20, the structure of all view types is the same as in Odoo 16, except that much has happened under the hood.
The snippets of code presented below were taken from actual addons, namely from hr, project, and sale, so you can open the corresponding files and compare your work with the examples. By the end, you will learn what kind of view types Odoo 20 provides, how they are defined in XML, and what changes you need to make when maintaining custom modules or themes.
The view types at a glance
Here’s what the view registry in the 20.0 community source contains:
| View | Root tag | Defined in | Typical use |
| List | <list> | web | Tabular records, editable lines |
| Form | <form> | web | Single record editing |
| Form | <kanban> | web | Cards, optionally grouped in columns |
| Calendar | <calendar> | web | Records placed on a date axis |
| Graph | <graph> | web | Bar, line and pie charts |
| Pivot | <pivot> | web | Cross-tab analysis |
| Activity | <activity> | mail | Matrix of records against activity types |
| Hierarchy | <hierarchy> | web_hierarchy | Parent/child org-chart style trees |
Note: the ir.actions.act_window view model from the base module includes six view modes: list, form, graph, pivot, calendar, and kanban. There is no view mode named Search view. We can consider it as the underlying structure for filters, group-by, and search bar functionality in all other views mentioned.
There are also several specific view types in the community source code that you will be able to choose by using js_class. These include activity_calendar, ir_attachment_kanban, ir_attachment_list and mail_activity_my_kanban. Views that are available only in enterprise edition, such as Gantt, Map, and Cohort, are not present in the community codebase.
List view
The list view does the heavy lifting for browsing records and for editable one2many lines.
Xml
<list default_group_by="stage_id">
<field name="name"/>
<field name="partner_id" optional="show"/>
</list>
A few Odoo 20 details are worth knowing. The attribute named string on the <list> is deprecated. js_class helps to swap in our own view class and now accepts a dialog_size attribute. The real thing is the <column> element.
Form view
The Form view is the core component of the UI and includes Header, Sheet, Button Box, Notebook, and Chatter. However, even though the same structure is used as in the case of this view type, there have been some updates on the client side of the architecture. In particular, the 20.0 version of the source code contains two additional Material-3-themed stylesheets, which are form_controller_m3.scss and form_controller_m3.dark.scss, and an additional stylesheet for the form label – form_label.scss. Besides, there are two more attributes of the buttons schema, namely icon_class and confirm-title.
<form>
<sheet>
<div class="oe_button_box" name="button_box" invisible="not id">
<button class="oe_stat_button" name="action_employee_from_department"
type="object" icon="group" icon_class="oi-filled">
<field string="Employees" name="total_employee" widget="statinfo"/>
</button>
</div>
<div class="oe_title">
<h1><field name="name"/></h1>
</div>
<group>
<field name="manager_id" widget="many2one_avatar_employee"/>
<field name="parent_id"/>
</group>
</sheet>
</form>
Kanban view
Kanban cards are built from a template named card. In the 20.0 source, no addon XML file still uses the older kanban-box name, while 153 files use t-name="card". Here’s a real example from hr:
Xml
<templates>
<t t-name="card" class="flex-row">
<aside class="o_card_aside_full">
<field name="avatar_256" widget="background_image"/>
</aside>
<main class="ms-2">
<field class="fw-bold fs-5" name="name"/>
</main>
</t>
</templates>
This is the <aside> and <main> structure used in the 20.0 employee kanban. What is new about it is the owner of the card logic. Before, the kanban parser was responsible for it, but starting from Odoo 20, it is delegated to a new shared card module.
While creating your QWeb template within a card, prefer t-out over t-esc:
Xml
<t t-out="record.total_employee.raw_value"/>
Calendar view
The calendar layout displays documents in a format that is day, week, month, or year-based. The project task calendar in the 20.0 source makes a nice reference:
Xml
<calendar date_start="date_deadline" string="Tasks" mode="month"
color="color" event_limit="5" hide_time="true"
event_open_popup="true" quick_create="0"
js_class="project_task_calendar" schedule="1"
scales="day,week,month,year">
<field name="project_id" widget="project"/>
<field name="user_ids" widget="many2many_avatar_user"/>
</calendar>
Graph and pivot views
Graph views (bar, line, and pie), as well as the pivot view (cross table), have the same structure and the same schema as Odoo 19. The RelaxNG file for the two views is identical too. The changes have been made on the client side only. Controllers, models, and renderers have been changed as part of the Owl migration, and a new graph_renderer.scss has been added for the graph view.
Activity view
Activity view resides in the mail and displays records in rows, while activity types appear in columns. The schema of the activity view, activity_view.rng, is the same as in Odoo 19. You just need to write <templates> tags along with an activity-box template for displaying record information.
Hierarchy view
Hierarchy view resides in web_hierarchy and displays the hierarchy of parent/child records in the form of a tree. This is how the hr module displays departments and employees:
Xml
<hierarchy child_field="child_ids" draggable="1">
<field name="name"/>
<field name="color"/>
<field name="total_employee"/>
<templates>
<t t-name="hierarchy-box">
<div class="o_hierarchy_node_header">
<field name="name"/>
</div>
<div class="o_hierarchy_node_body d-flex flex-column">
<field name="manager_id" widget="many2one_avatar_employee"/>
</div>
</t>
</templates>
</hierarchy>
Internally, HierarchyCompiler now extends the new shared CardCompiler. So, hierarchy nodes and kanban cards are built on the same rendering base.
What’s new in Odoo 20
1. Owl reactivity moves to signals
If you only remember one thing from this post, make it this one. This is the major difference, which has the greatest chance of breaking a custom module. This is the counted usage on both branches:
| Pattern | Odoo 19 | Odoo 20 |
| useState( | 46 | 0 |
| signal( | 0 | 24 |
| useProps | 0 | 331 |
Components from Odoo 20 import signal, t, useProps, and usePlugin from @odoo/owl. Props are defined using useProps and can be any of these types – t.any(), t.object(), or t.function(), instead of the static props which were used before. The local state is stored in the signals, and you can access them using the function call notation like this – collapsed = signal(false); this.collapsed(). If you keep developing your own view/field widget, please reserve some time for this.
2. A shared Card module
Folder name in Odoo 20 is web/views/card, and it has files like card.js, card_arch_parser.js, card_compiler.js, card_renderer.js, and card_popover. In the case of Odoo 19, the card template was part of the kanban template itself, but now it has been removed, and it is being reused by other views as well. This can be understood from the code, where it is used by the Kanban view and record, x2many field, calendar popover, and hierarchy compiler. The file kanban_compiler.js is no longer available. There is only one point to be noted in the arch parser:
If there is no widget available for a many2many field, then it comes under many2many_tags in a card.
3. Calendar: scheduling and card popovers
The calendar has received an addition in the form of the sidebar section “to schedule”. With schedule="1", the side panel lists the records that have no date yet, with a count ("%s to schedule" or "Nothing to schedule") and a load more button. Records are considered dated when you drag them from the list and drop them in the calendar. Implementation of this functionality occurs with the help of the CalendarScheduleSection component and FullCalendar’s draggability.
The other schema update is related to the <popover> tag that is supported inside the <calendar> tag, which may or may not have card_id with fields and <templates>. With this possibility, you can create events in popovers with the help of templates as the kanban cards. One point worth mentioning is that the date_delay parameter has been removed from the schema.
4. List view: grouped columns and multi-record drag
This schema is now extended with <column>, an element that can contain multiple fields in one column. The Odoo 20 sales order line list uses this schema to combine product, variant, and description fields into one column titled "Description":
Xml
<column name="product_and_description" string="Description">
<field name="product_template_id" string="Product"/>
<field name="product_id" string="Product Variant"/>
</column>
There’s also a new multi_drag.js helper, used by both the list renderer and the kanban renderer. It lets you drag several selected records together as one block.
5. Search view: filter changes
The filter definition in the common.rng file has been changed. Currently, the Date filter is composed of the date, end_date, and default_period parameters, while parameters such as start_month, end_month, start_year, and end_year are no longer used. The filters in the schema have been categorized into two categories where the first category consists of the filter which is composed of the obligatory name parameter and the second category of the filter that has an obligatory string parameter.
Xml
<filter name="filter_date" date="start_date" default_period="year" string="Period"/>
6. Offline-aware action helper
The Views folder has the offline_action_helper.js file included in it. It gets to know the saved searches that are available for the particular action and view type, and it provides you with the reset filter option. This is the view layer piece of the offline capability which comes along with the web client version 20.0. I have considered only this helper and not the entire offline plugin itself.
7. Field widget housekeeping
The folders in the fields folder have been moved. Some of the new folders are badges_selection, badges_many2one, many2one_binary, many2x_binary, many2many_tags_color_dot, float_time_tz, and additional_identifiers. The folders badge_selection and badge_selection_with_filter no longer exist. It is important to check where your widget is located if there is any module that has imported or extended your widget.
Migration checklist for custom modules
- Use signals instead of useState in custom view and field components and read the signals through functions.
- Declare the props with useProps and t types.
- Change all imports of kanban_compiler to card compiler.
- Use t-out in place of t-esc in QWeb templates.
- Remove date_delay from calendar views and replace start_month-style attributes in search filters with date, end_date, and default_period.
- Check the widget imports according to the new field folder name.
- Test your custom calendar according to the new schedule and .
The view types architecture remains unchanged – list, form, kanban, calendar, graph, pivot, activity and hierarchy. The main changes lie in the internals: signals approach instead of useState, a common card layer for kanban, calendar popovers and hierarchy, the calendar can now give dates to undated records, and lists can combine several fields in one column now. If you work with custom views, then most of the time you will spend on adaptation to Owl.
Most existing views should keep working; the only exceptions are the deleted attributes like date_delay for calendar views and outdated date attributes in search filters. Graphs, pivots, and activities schemas remained the same; the Kanban view continues to use card templates, while the calendar schedule, components, and element in lists offer numerous new options for styling without JS coding.
As soon as you decide to upgrade your app to Odoo 20, you will have to analyze all of your custom components that are based on useState first of all. Then, you need to install Odoo 20 locally and review views in the hr, project, and sale modules, and adapt your views one by one.
To read more about Overview of Basic Views in Odoo 19, refer to our blog Overview of Basic Views in Odoo 19.