Skip to main content
iVentureTeam
Odoo Implementation

Odoo OWL Custom View Tutorial: Components, Registry and 19/20 Pitfalls

Build an Odoo OWL custom view in Odoo 19 and 20: components, templates, js_class, the views registry, Python hooks and the Owl 3 upgrade pitfalls to fix.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
November 26, 202612 min read0 views
Odoo OWL Custom View Tutorial: Components, Registry and 19/20 Pitfalls cover

A custom view is often the best way to show data that list and kanban views cannot: a floor plan, a timeline, a capacity board. Our Odoo customization services build these views and keep them upgrade-safe.

Related service: Odoo implementation services — fixed-scope implementations with a named senior team.

This Odoo OWL tutorial is for developers, technical leads and IT managers who own custom Odoo code. If you are new to modules, start with our guide to Odoo module development, then come back for the view layer.

What is an Odoo OWL custom view?

An Odoo OWL custom view is a view type, or a variant of one, written as Owl components and loaded by the Odoo web client. Owl is the Odoo JavaScript framework behind the backend web client in current versions.

Every standard view is a plain JavaScript object. It names a Controller, a Renderer, often a Model and an ArchParser, plus settings such as type, display name and icon. The web client looks the object up by key in the views registry.

Odoo's own developer guide, Customize a view type, shows both routes. Note that the 20.0 page still uses Owl 2 style code, so check the 20.0 source before you copy it.

Should you extend a view or build a new view type?

Extend an existing view when you only need extra UI on top of standard behavior; build a new view type when the layout itself is different. Most business requests fit the first route.

NeedExtend with js_classNew view type
Banner, button or KPI strip above recordsBest fitToo heavy
Different card layout or grouping logicGood fit, extend the rendererOnly if kanban rules get in the way
Floor plan, Gantt-like board, map, tree diagramPoor fitBest fit
Python changes neededNone, arch attribute onlySelection values, icon and validator
Upgrade effortLow to mediumMedium to high
Studio can do it insteadSometimesNo

If the request is only fields or filters, compare the effort with Studio first; see Odoo Studio vs custom development. For printed output, a QWeb report in Odoo 19 and 20 is simpler.

What files does an Odoo custom view need?

A custom view needs JavaScript files for the logic, XML files for the QWeb templates and a manifest entry that loads both into the backend asset bundle. Keep them under one folder per view.

A typical layout inside your module is static/src/views/my_view/ with one file per part. Odoo transpiles files under /static/src into Odoo modules by default, as the JavaScript modules reference explains.

FileRoleNeeded when
my_view_controller.jsOwl component that holds Layout, search and the rendererBoth routes
my_view_renderer.jsOwl component that draws the recordsNew view, or custom kanban look
my_view_model.jsLoads and holds data through the orm serviceNew view type
my_view_arch_parser.jsReads attributes from the view archNew view type
my_view.jsView object plus the registry lineBoth routes
my_view.xmlQWeb templates with a unique t-name per componentBoth routes

In the manifest, add an assets key with a web.assets_backend list that includes your static/src files. The asset management guide shows the glob syntax and the other bundles.

How do you extend a kanban view with js_class?

Subclass the standard controller or renderer, spread the standard view object into a new one, register it under a new key, then set js_class to that key in the arch. This is the fastest Odoo kanban view customization.

  1. Import the parts: KanbanController and kanbanView from the web module's kanban folder, plus registry from the core registry module.
  2. Subclass: create a class that extends KanbanController and give it a new static template name, for example my_module.CustomKanbanView.
  3. Template: write a QWeb template with that t-name that inherits web.KanbanView and inserts your markup before or after the Layout node with xpath.
  4. View object: spread kanbanView into a new object and replace only the Controller key with your class.
  5. Register: add the object to registry.category("views") under a unique key such as my_module_custom_kanban.
  6. Arch: in the kanban view record, or an inherited view, set js_class to the same key.

Keep the key and the js_class value identical, and prefix keys with your module name.

How do you build a new Odoo custom view type from scratch?

A new view type needs a controller, a renderer, a model, an arch parser and a view object, plus Python code that teaches the server the new view tag. Plan it as a small module of its own.

  1. Controller: an Owl component whose template wraps the renderer in Layout, so the control panel and search bar appear.
  2. Model: a class that receives the orm service, model name, fields, domain and parsed arch, and loads records in a load method.
  3. Renderer: an Owl component that receives records as props and draws them.
  4. Arch parser: extends XMLParser from the core xml utilities and returns the attributes your view reads from its arch.
  5. View object: sets type, display name, icon, multiRecord, the four classes and a props function that parses the arch and passes it down.
  6. Registry: add the view object to the views registry under the same name as the arch tag.
  7. Python: extend ir.ui.view with selection_add on the type field, and ir.actions.act_window.view with selection_add on view_mode with an ondelete rule.
  8. Server hooks: override _get_view_info to return the icon, and add a _validate_tag method for your tag so bad arches fail at install.

Odoo's hierarchy view module uses this server pattern in 19.0 and 20.0. Step 7 is the one tutorials most often skip.

How does the Odoo view registry work?

The views registry is a key-value store in the web client: the key is the view type or js_class value, and the value is the view object. If the key is missing when the action opens, the view fails.

The registries reference lists the rules that matter here:

  • Unique keys: add throws an error if the key already exists, unless you pass the force option.
  • Ordering: the sequence option sets the position when code reads all entries.
  • Lookups: get throws a KeyNotFoundError with the message Cannot find key in the registry when nothing was added.
  • Categories: views, fields, actions and services each live in their own sub-registry.

A KeyNotFoundError almost always means the file never loaded or the key is spelled differently. One Odoo 16 developer hit Cannot find owl.dashboard in this registry for exactly that reason. Check the asset bundle first.

What changes for OWL custom views in Odoo 20?

OWL custom views: What changes from Odoo 19 to 20?

Odoo 20 moves the web client from Owl 2 to Owl 3, so the component, template and state patterns you used in Odoo 19 change. A compatibility layer softens the move but does not cover everything.

AreaOdoo 19 (Owl 2.8)Odoo 20 (Owl 3 build)
Props schemastatic props on the classprops = useProps with a t schema
Local stateuseStateproxy or signal
DOM refsuseRef with a string t-refsignal.ref with t-ref on this.rootRef
Template scopeprops.x workscore templates write this.props.x
Slotst-slott-call-slot
Text outputt-esc and t-outt-out, t-esc logs a warning

The 20.0 source loads a file named owl3_compatibility_layer.js right after Owl. Its own header calls it a temporary bridge for incremental migration, so do not build new views on it.

The same file asks you to rename t-portal to t-custom-portal and t-model to t-custom-model, and to use useLayoutEffect in place of useEffect until you migrate.

The 20.0 source also adds a new card view type to ir.ui.view, and Odoo's hierarchy view swapped its Font Awesome icon class for a symbol name. Check your own view icons after the move.

What are the common Odoo 20 upgrade pitfalls for custom views?

The most common failures are props declared the old way, templates that read variables without this, and state hooks that no longer exist. Most of them break the screen at load, not at install.

  • Static props error: the compatibility Component throws when a class defines static props or defaultProps and tells you to use useProps instead.
  • Blank templates: Owl 3 builds the render context around this, so bare props and state names resolve to undefined.
  • Missing imports: useState and useRef are not exported by the Owl 3 build, so imports fail at load.
  • Slots: t-slot calls need t-call-slot, which the 20.0 Layout template already uses.
  • Copied docs: the 20.0 view howto is identical to the 19.0 page, so code pasted from it carries Owl 2 habits.
  • Arch rules: Owl directives such as t-on-click are refused inside list and form arches, as one Odoo 17 forum thread on forbidden Owl directives shows.

Run a full inventory of custom JavaScript before you plan the move. Our checklist for Odoo 20 upgrade custom modules covers the Python side, and the Odoo custom module upgrade guide covers testing.

How do you test and debug an OWL custom view?

Test a custom view on a copy of real data, with assets in debug mode, and add a small unit test for each view. That catches registry and template errors before users do.

  1. Debug assets: open the backend with debug=assets so stack traces point to your file and line, not a minified bundle.
  2. Console first: read the first red error; registry, template and props errors name the exact key or component.
  3. Unit tests: add files under static/tests and load them in the web.assets_unit_tests bundle.
  4. Real data: load a copy of production on staging, as empty databases hide performance and grouping bugs.
  5. Every route: open the view from menus, from smart buttons and in a dialog, since each passes different props.

To see how much custom code a database carries, run our free Odoo health check tool.

Which industries need an Odoo custom view?

Custom views pay off where staff make decisions from a visual layout rather than a list. These are the patterns we see most often.

IndustryPain or cost driverOdoo approachHow iVentureTeam helps
ManufacturingPlanners juggle work centers in spreadsheetsCapacity board view on work ordersBuild the board, link it to MRP data
Warehousing and 3PLPickers cannot see bin locationsFloor plan view on stock locationsMap locations, add color rules
Hospitality and eventsRoom or table status is hard to scanGrid view by date and resourceDesign the grid, tie it to bookings
Field serviceDispatchers need jobs by area and timeMap or timeline view on tasksExtend views, add filters
Professional servicesManagers miss over-booked staffHeat map view on timesheetsBuild the view and KPI strip

How iVentureTeam helps build Odoo OWL custom views

How much custom code? Check your database

iVentureTeam designs, builds and upgrades OWL custom views as part of clean, documented Odoo modules. We have delivered 150+ ERP projects across 35+ countries with 40+ Odoo specialists, led by a consultant with 13+ years in Odoo.

  • Fit check: we confirm whether js_class, a new view type, Studio or a report costs least.
  • Build: our Odoo development company team writes the component, template, model and Python hooks with tests.
  • Owl 3 port: we move Odoo 19 views to useProps, proxy, signals and this-scoped templates for Odoo 20.
  • Upgrade projects: custom views are reviewed as part of our Odoo upgrade services.
  • Extra capacity: you can also hire an Odoo developer who works inside your own repository.

Odoo OWL custom view case study: MechSoft

A Turkish IT firm got live KPI dashboards inside Odoo through a custom dashboard module, without a disruptive version upgrade. MechSoft ran its operations on Odoo 11.

Reporting meant exporting data and rebuilding charts by hand outside Odoo, and there was no native way to build branded management dashboards in Odoo 11.

We built a dashboard module with line, bar, pie, area, doughnut, polar-area, tile and list items powered by Highcharts JS, plus KPI cards against targets and prior periods. It added edit mode, drag to move, date and domain filters, and multi-company support.

Managers now watch auto-refreshing KPIs inside Odoo on any device, and any chart exports to PNG, PDF, Excel or CSV. Read the MechSoft Odoo dashboard customization case study.

The bottom line on Odoo OWL custom views

Build an Odoo OWL custom view when the layout drives daily work, and write it for the Owl version you will run next, not the one you run today. In 2026 that means planning for Owl 3.

Start with js_class whenever you can, keep keys and templates prefixed with your module name, and avoid core patches. If you already have Owl 2 views, budget a code pass for useProps, state, refs and template scope before your Odoo 20 move.

Ready to build or port your Odoo custom view?

Ask for a view code review

Get a developer review of your view code before it blocks your upgrade. Ask for an OWL custom view review, call +91-90235-15208, or email business@iventureteam.com.

Frequently Asked Questions

What is OWL in Odoo?

+

Owl is the Odoo JavaScript framework used to build the backend web client. It provides components, QWeb templates and reactivity. Odoo 19 ships Owl 2.8, and the Odoo 20 source ships an Owl 3 build.

What is js_class in Odoo?

+

js_class is an attribute on a view arch, such as a kanban or list tag, that tells the web client to use a custom view object from the views registry instead of the standard one. The value must match the registry key exactly.

How do I create a custom view in Odoo 19?

+

Write a controller, renderer, model and arch parser as Owl components and classes, combine them in a view object and add it to the views registry. Then extend ir.ui.view and the window action view mode in Python.

Do Odoo 19 OWL views work in Odoo 20?

+

Not without changes. Odoo 20 runs an Owl 3 build with a temporary compatibility layer. Static props now throws an error, useState and useRef are gone, and templates should read values through this.

Why do I get KeyNotFoundError for my custom view?

+

The views registry has no entry for the key in your js_class or view tag. Usually the JavaScript file is not in web.assets_backend, or the key is spelled differently in the arch and the registry call.

Can Odoo Studio create a custom view type?

+

No. Studio can change fields, existing views and reports, but a new view type or a custom renderer needs code in a module. Many simple requests still cost less in Studio.

How long does it take to port a custom view to Odoo 20?

+

It depends on how many components, patches and templates the view has. A small js_class extension may take hours, while a full view type with patches can take days, so inventory the code first.

Free customization review

Need Odoo to fit the way you work?

Tell us what you want to change. We show what Odoo does out of the box, what Studio covers and what needs custom code.

Free, with no obligation. A senior consultant replies within 12 business hours.

We use cookies to improve your experience

Essential cookies make the site work, and we use analytics to improve it. Choose “Only necessary” to turn analytics off. See our cookie policy.