Odoo Updates · Upgrades
Upgrading custom Odoo modules from 16 to 19: what changes
Odoo 16 has left Odoo's standard support, and the jump to 19 crosses three releases of API changes. Here is what breaks in custom modules, with the old and new code side by side, and a five-step checklist that fits inside our upgrade method.
Key takeaways
- Odoo's upgrade service moves your data and standard apps. Custom modules are yours to fix.
- Odoo 17 removed attrs and states from views, so every conditional field needs rewriting.
- Odoo 18 renamed tree views to list and group_operator to aggregator.
- Widgets built on the legacy JavaScript framework must become OWL components.
- Run the upgrade on a copy, and rehearse the data move twice before cutover.
If your database runs on Odoo 16, it now sits outside Odoo's standard support, which covers only the three most recent major releases. Staying put means paid extended support, with bug fixes where feasible. Odoo 20 shipped in September 2026; for most databases we recommend landing on 19 first and moving to 20 once it matures. The standard apps are the easy part of moving on. Odoo's upgrade service, or the OCA's OpenUpgrade project for Community databases, carries the data and the standard modules forward. Custom modules are not covered. Every module your team or a previous partner wrote has to be made compatible with version 19 by someone who reads the code.
This guide lists the changes between 16 and 19 that break custom code most often, shows the old and new patterns side by side, and ends with the plan we follow. It assumes you know what a custom module is and have seen an Odoo view definition. It is not a full list of API changes. For the rest, read Odoo's ORM changelog, its guide to upgrading a customized database and your own server log.
Why 16 to 19 is three upgrades, not one
Odoo ships one major version a year. From 16 you cross 17, 18 and 19, and the changes stack: a view that works in 16 breaks in 17, and the fixed version needs another edit for 18. For an Enterprise database, the upgrade service can normally make the whole jump in one request, once you have run a test upgrade first. OpenUpgrade runs one version at a time. The custom code is rewritten once, for 19, but it pays to apply the changes in version order so nothing is skipped.
Some teams prefer to stop at 18, stabilize, and move to 19 later. That halves the change in each step but doubles the testing, the user briefings and the cutover weekends. The single jump is workable: SF Dyes, a dye manufacturer, moved from Odoo 13 to 18 in one migration with every custom module rewritten, and saw zero disruption at go-live. Which route fits depends on how much custom code you carry and how much your team can test at once.
Odoo 17: attrs and states are gone from views
The change that touches the most lines of custom code is in the view layer. Up to 16, conditional behavior was written as a domain inside an attrs dictionary, and buttons used states to appear only in certain states. Odoo 17 removed both. Conditions now go straight into the invisible, readonly and required attributes as Python expressions, and list columns use column_invisible.
Odoo 16
<field name="discount_reason"
attrs="{'invisible': [('discount', '=', 0)],
'required': [('discount', '>', 10)]}"/>
<button name="action_approve" type="object" string="Approve"
states="to_approve"/>Odoo 17 and later
<field name="discount_reason"
invisible="discount == 0"
required="discount > 10"/>
<button name="action_approve" type="object" string="Approve"
invisible="state != 'to_approve'"/>Three details catch people. A field used in a condition must be present in the view, even if it is hidden, or the view fails validation. Inherited views that changed attrs through position="attributes" now have to set the individual attribute instead. And the states= parameter on Python field definitions went away in the same release, so a "read-only unless draft" rule moves into the view.
<!-- Odoo 16 -->
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="attrs">{'readonly': [('state', '!=', 'draft')]}</attribute>
</xpath>
<!-- Odoo 17 and later -->
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>Scripts can convert the bulk of these, but read every result. Nested conditions built with | and & operators are where an automated conversion most often needs a second look.
Odoo 17: name_get gives way to _compute_display_name
Custom record labels, such as a product code shown in front of a name in a dropdown, used to come from overriding name_get. In 17 that method is deprecated, and display_name is a computed field you fill in _compute_display_name.
# Odoo 16
def name_get(self):
return [(rec.id, f"[{rec.code}] {rec.name}") for rec in self]
# Odoo 17 and later
@api.depends('code', 'name')
def _compute_display_name(self):
for rec in self:
rec.display_name = f"[{rec.code}] {rec.name}"Search every module for name_get, including code that calls it on other models to build text for reports or exports. Those callers should read display_name instead.
Renamed fields in the core models you extend
Your code also depends on the fields of the models it extends, and some of those changed. Two examples from inventory show the pattern. In 17, the stock move line's qty_done gave way to quantity plus a picked flag, so code that wrote done quantities needs rework. In 18, the storable product type was folded into goods with an "is storable" checkbox, so a check for the old type stops matching anything.
# Odoo 16 and 17
storable = product.type == 'product'
# Odoo 18 and later
storable = product.is_storableThe first line does not raise an error on 18. It quietly returns False, and whatever depended on it stops happening. That is why a module that installs cleanly still needs its workflows tested.
Odoo 18: tree becomes list, group_operator becomes aggregator
Odoo 18 renamed the list view. The root element in the view definition is now list instead of tree, and window actions use list in view_mode. On the Python side, the field attribute that sets how a column totals in grouped views, group_operator, is now aggregator.
<!-- Odoo 16 and 17 -->
<tree>
<field name="name"/>
<field name="purity"/>
</tree>
<field name="view_mode">tree,form</field>
<!-- Odoo 18 and later -->
<list>
<field name="name"/>
<field name="purity"/>
</list>
<field name="view_mode">list,form</field>purity = fields.Float(group_operator='avg') # Odoo 16 and 17
purity = fields.Float(aggregator='avg') # Odoo 18 and laterSearch your XPath expressions too. An inherited view that targets //tree in a core view will not find it once the core view uses list.
The web client: legacy widgets become OWL components
Odoo 16 already ran its main views on OWL 2, Odoo's component framework, but it still carried the older widget framework for code that had not moved. That layer has since been removed. A custom field widget, client action or view extension written with Widget.extend or the legacy field registry has nothing left to attach to in 19. It has to be rebuilt as an OWL component and registered in the current registry.
This is often the most expensive line in an upgrade estimate, because there is no mechanical conversion. So ask of each widget whether it is still needed. Some custom widgets duplicate something Odoo now ships, and a widget you retire costs nothing to upgrade.
Odoo 19: let the server log write the list
Odoo 19 continued the same clean-up of older APIs. Rather than work from someone else's list, install each module on a clean 19 database with tests enabled and read the log. Every deprecation warning is a line item, and every failed test is a workflow to fix. A module with no tests needs a few written against 16 before the rewrite starts, so there is something to compare its new behavior with.
| What changed | Version | What to do in your module |
|---|---|---|
attrs and states in views | 17 | Python expressions in invisible, readonly, required |
states= on field definitions | 17 | Move the rule into the view |
name_get | 17 | Override _compute_display_name |
Stock move line qty_done | 17 | Use quantity and picked |
<tree> views, view_mode tree | 18 | Rename to list, fix XPaths |
group_operator | 18 | Rename to aggregator |
| Storable product type | 18 | Check is_storable |
| Legacy JavaScript widgets | Across 16 to 19 | Rebuild as OWL components, or retire |
| Anything else | 19 | Read the deprecation warnings and failed tests |
A five-step plan for the upgrade
Here is the sequence we recommend. As in every stage of our Odoo upgrade and migration engagements, each step has exit criteria that are met before the next one starts.
- Inventory every custom module. List each module with its models, views, reports, scheduled actions, JavaScript and integrations, plus marketplace apps and Studio changes. Mark each one keep, replace with standard, or retire. Retiring is the cheapest upgrade there is.
- Run the upgrade on a copy. Request a test upgrade from Odoo's upgrade service, or run OpenUpgrade for Community, on a recent copy of production, never on the live database. Build the new server at the same time: Odoo 17 raised the minimum Python version to 3.10, so a server set up for 16 often needs a new environment.
- Rewrite views and code in version order. Apply the 17 changes, then the 18 changes, then whatever the 19 log reports. Keep each module in its own branch with its tests, and compare its behavior against 16 before sign-off.
- Re-test every report. Print each QWeb report from 16 and 19 side by side: invoices, delivery slips, and any document a customer or vendor checks against a format. Layout changes shift page breaks and totals, and a report that renders is not the same as a report that is right.
- Rehearse the data move, ideally twice. Run the full upgrade on a fresh production copy, reconcile record counts and balances, and time every step. Then do it again with the fixes applied. The second rehearsal gives you a cutover window you can plan a weekend around, and a rollback point you have already tested.
Cutover then runs in a planned low-activity window. At SF Dyes, the migrated system ran in parallel with live Odoo 13 before cutover, users tested it by role, and our team stayed on hand through the first production week.
Make the next upgrade smaller. Our practice is to return every module we rewrite with automated tests, a migrations folder and an upgrade estimate for the next release. The habits that make 16 to 19 expensive, such as untested code and edits to core behavior, are the ones upgrade-safe customization avoids.
Frequently asked questions
Can we upgrade straight from Odoo 16 to 19?
Yes. Odoo's upgrade service can move an Enterprise database across several versions in one request, while OpenUpgrade for Community steps one version at a time. Custom modules are rewritten directly for 19. Stopping at 18 first is the alternative, at the cost of two rounds of testing and two cutovers.
Does Odoo's upgrade service upgrade our custom modules?
No. It upgrades the database and Odoo's standard modules. Custom modules have to be made compatible with the new version by whoever maintains them, with migration scripts for any data they need to reshape. That is why we audit the modules before we quote.
How long does an Odoo 16 to 19 upgrade take?
It depends on how much custom code you have and how much of it touches the web client. We give dates after auditing your modules, not before, and we recommend planning two data rehearsals rather than one.
If a custom module installs on Odoo 19, does it work?
Not necessarily. Renamed core fields can make an old comparison quietly return False instead of raising an error. Only tested workflows prove that a module still does what it did on 16.
Still on Odoo 16?
30 minutes: bring your module list and we will tell you what the jump to 19 touches.
Book a discovery callKeep going
Related services and articles
Plan the move off Odoo 16
Custom modules audited and rewritten, data verified against the source before cutover.
Odoo upgrade and migration servicesFive versions in one migration
SF Dyes moved from Odoo 13 to 18 with every custom module rewritten and zero disruption at go-live.
SF Dyes migration case study Odoo UpdatesOdoo 19 vs Odoo 18: what changed and should you upgrade?
What changed in accounting, manufacturing and eCommerce, and how to time the upgrade.
ImplementationOdoo customization: how much is too much?
When to write a custom module, when to adapt the process, and how to keep code upgrade-safe.
Find out what your Odoo 16 upgrade will touch
The first call takes 30 minutes.
Or email sales@octagotech.com- USA +1 917 254 9416
- India +91 8153897751