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
- Find all
attrs=occurrences in your XML files - Extract each attrs dictionary key (invisible, readonly, required, column_invisible)
- Convert the domain from tuple syntax to expression syntax
- Add as direct attributes on the element
- Remove the
attrsattribute - Test each view thoroughly
Python API Changes
Model Changes
_inheritbehavior with_namewas clarified — delegated inheritance patterns need review- Computed field
store=Truebehavior was refined for performance - The
@api.onchangedecorator continues working butcomputewithprecompute=Trueis 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.Widgetlegacy 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
- Back up database and filestore completely
- Use OpenUpgrade (Community) or upgrade.odoo.com (Enterprise) for database schema migration
- Update all custom modules: manifest version, attrs removal, API changes
- Update third-party modules to v17-compatible versions
- Install migrated database with updated modules on a staging server
- Run
-u allto trigger module upgrades - Test all workflows: sales, purchasing, inventory, accounting, reports
- 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
attrspatterns - Regex-based scripts can handle 80% of cases automatically
- Complex
attrswith 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.