Skip to content

Migrate Odoo 16 to 17: Complete Migration Guide

DeployMonkey Team · March 23, 2026 10 min read

Overview

The Odoo 16 to 17 migration is one of the more impactful upgrades in recent Odoo history. Version 17 removed the attrs attribute from views (a change that broke nearly every custom module), introduced new domain syntax in views, overhauled the frontend with OWL 2 improvements, and made significant UI/UX changes. Plan carefully.

The Big Change: attrs Removal

The most breaking change in Odoo 17 is the removal of the attrs attribute from XML views. In Odoo 16 and earlier, you controlled field visibility and editability like this:

<field name="partner_id" attrs="{'invisible': [('state', '=', 'draft')], 'required': [('type', '=', 'service')]}"/>

In Odoo 17, this becomes direct attributes:

<field name="partner_id" invisible="state == 'draft'" required="type == 'service'"/>

Every custom module with view definitions using attrs needs updating. This is typically the largest part of the migration effort.

Domain Syntax in Views

Odoo 17 introduced Python-like domain expressions in views alongside the old tuple syntax. The new syntax is more readable:

  • Old: [('state', '=', 'draft')]
  • New: state == 'draft'

Both syntaxes work in v17, but the new syntax is preferred. When migrating attrs to direct attributes, use the new syntax.

View Migration Steps

  1. Find all attrs= occurrences in your XML files
  2. Extract each attrs dictionary key (invisible, readonly, required, column_invisible)
  3. Convert the domain from tuple syntax to expression syntax
  4. Add as direct attributes on the element
  5. Remove the attrs attribute
  6. Test each view thoroughly

Python API Changes

Model Changes

  • _inherit behavior with _name was clarified — delegated inheritance patterns need review
  • Computed field store=True behavior was refined for performance
  • The @api.onchange decorator continues working but compute with precompute=True is preferred for new code

Controller Changes

  • Website controller routing was updated again
  • JSON-RPC error handling was standardized
  • Session handling improvements affect custom authentication

OWL and Frontend

Odoo 17 continued the OWL migration with more legacy widgets replaced by OWL components. If your modules have custom JavaScript:

  • The web.Widget legacy class is further deprecated
  • New component lifecycle hooks replace old patterns
  • Service registry changes affect how custom services are registered
  • Asset bundling syntax in manifests was updated

UI/UX Changes

Odoo 17 brought significant UI changes:

  • New default theme and color scheme
  • Updated navigation sidebar design
  • Form view chatter redesign
  • List view improvements with optional fields
  • Settings page reorganization

Custom CSS and theme overrides may break. Review all custom styling.

Database Migration Process

  1. Back up database and filestore completely
  2. Use OpenUpgrade (Community) or upgrade.odoo.com (Enterprise) for database schema migration
  3. Update all custom modules: manifest version, attrs removal, API changes
  4. Update third-party modules to v17-compatible versions
  5. Install migrated database with updated modules on a staging server
  6. Run -u all to trigger module upgrades
  7. Test all workflows: sales, purchasing, inventory, accounting, reports
  8. Fix issues, retest, and repeat until stable

Automated attrs Migration

Several community tools help automate the attrs to direct-attribute conversion:

  • OCA's migration script handles straightforward attrs patterns
  • Regex-based scripts can handle 80% of cases automatically
  • Complex attrs with nested conditions may need manual conversion

Always review automated conversions. Edge cases (attrs in xpath expressions, dynamic attrs from Python) require human judgment.

Testing Strategy

  • Run all existing Python tests — fix failures before proceeding
  • Test every custom view by navigating to it
  • Test field visibility/editability conditions (previously handled by attrs)
  • Verify all reports generate correctly
  • Test automated actions, scheduled jobs, and email templates
  • Have end users test their daily workflows

Common Pitfalls

  • attrs in xpath inherit views: Inherited views that modify attrs need special attention
  • Dynamic attrs from Python: Code that sets attrs dynamically needs refactoring
  • CSS class changes: Button and form styling classes changed
  • Chatter position: Form views with custom chatter positioning may break

DeployMonkey

Deploy Odoo 16 and 17 instances side by side on DeployMonkey for safe migration testing. The AI agent can analyze your custom modules and identify attrs patterns that need migration.