Overview
Odoo 18 introduced several view-level changes building on v17's attrs removal. While v17 was the major breaking change for views, v18 added new requirements, deprecated more patterns, and tightened validation. This guide focuses specifically on view migration with practical before/after examples.
List View Changes
The <tree> tag generates deprecation warnings in v18 (fully removed in v19). Start using <list> now:
Before (v17)
<tree string="Orders">
<field name="name"/>
<field name="partner_id"/>
<field name="amount_total"/>
</tree>After (v18)
<list string="Orders">
<field name="name"/>
<field name="partner_id"/>
<field name="amount_total"/>
</list>This is a simple find-and-replace but also update your inherited views that use xpath with //tree — change to //list.
Form View Requirements
Odoo 18 enforces the <sheet> wrapper in form views more strictly. Views without <sheet> may render incorrectly or throw warnings:
Before (v17 — worked without sheet)
<form>
<group>
<field name="name"/>
<field name="description"/>
</group>
</form>After (v18 — sheet required)
<form>
<sheet>
<group>
<field name="name"/>
<field name="description"/>
</group>
</sheet>
</form>Dashboard Views
Odoo 18 overhauled dashboard views. The old <dashboard> XML syntax was replaced:
Before (v17)
<dashboard>
<group>
<aggregate name="total" field="amount" string="Total"/>
<aggregate name="count" field="id" string="Count" group_operator="count"/>
</group>
<view type="graph"/>
<view type="pivot"/>
</dashboard>After (v18)
Dashboard views now use a component-based structure with updated attribute names and grouping logic. Check the official documentation for your specific dashboard patterns, as the migration is not a simple rename.
Button Styling
Button CSS classes were updated in v18:
oe_highlightclass is deprecated — usebtn-primarydirectlyoe_stat_buttonstyling was updated — check your stat button icons- Button
type="action"syntax changed for server actions
Before
<button name="action_confirm" type="object" string="Confirm" class="oe_highlight"/>After
<button name="action_confirm" type="object" string="Confirm" class="btn-primary"/>Field Widgets
Several field widgets were updated or replaced:
widget="many2many_tags"— behavior unchanged but styling updatedwidget="statusbar"— validates field is Selection typewidget="monetary"— strictercurrency_fieldvalidationwidget="html"— updated editor component (OWL-based)
Chatter and Activity
The chatter (<div class="oe_chatter">) structure changed in v18. If you have custom chatter positioning or styling:
Before
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>After (v18)
The chatter now uses a component-based rendering. The field declarations remain similar but the wrapper and positioning within the form view follow new conventions. Place the chatter block after </sheet> as before, but ensure no custom CSS overrides the new layout system.
Search View Updates
- Filter syntax remains stable but
domainexpressions now accept the Python-like syntax introduced in v17 - Search defaults via context are validated more strictly
- Groupby fields are validated against the model at install time
XPath in Inherited Views
XPath expressions in inherited views are more strictly validated in v18:
- Malformed xpath raises
ValueErrorat install time (previously silently ignored) - XPath targeting removed elements raises a clear error instead of being skipped
- The
position="attributes"operation validates that the target attribute name is valid for the element type
Migration Automation Script
For large codebases, consider writing a migration script:
- Replace
<treewith<listand</tree>with</list> - Replace
//treein xpath expressions with//list - Replace
class="oe_highlight"withclass="btn-primary" - Add
<sheet>wrappers to form views missing them - Review each change manually — automated replacements can break xpath selectors
DeployMonkey
Use DeployMonkey to deploy Odoo 17 and 18 instances side by side during view migration. The AI agent can identify deprecated view patterns and suggest corrections.