XPath View Inheritance Risk
A finding from the Migration Audit that flags XPath expressions in view inheritance which may target nodes that changed between Odoo versions.
What This Finding Means
The module inherits a view with an xpath expression that points to a specific node in the parent view. If the structure of that parent view changes between versions, the selector may no longer match.
Why It Matters
When an XPath expression matches nothing, Odoo raises an error while loading the inheriting view, which can block the module from installing or upgrading. Odoo regularly renames CSS classes, restructures form sheets, and removes nodes between versions.
Old Odoo Example
<xpath expr="//div[@class='o_form_sheet']" position="inside">
<field name="x_custom_note"/>
</xpath>Target Version Risk
- Any version where the targeted node was renamed, restructured, or removed
- Class-based selectors are especially fragile across major version jumps
Recommended Fix Direction
Prefer anchoring the XPath on a stable field name rather than a CSS class, for example targeting an existing field node and using position relative to it. Re-check the selector against the parent view in the target version before upgrading.
How to Verify Manually
Open the inherited view in the target Odoo version and inspect the parent view structure. Confirm the target node still exists with the same path, then load the form and verify the inherited content appears where expected.
Related Odoo Doctor Tool
The Migration Audit scans view inheritance for XPath expressions and reports selectors that may need rechecking against the target version.
Run Migration Audit