Home › Curriculum › Odoo Developer › View inheritance and XPath in practice
Views, actions, reports and OWL · 16 min · 17–20View inheritance and XPath in practice
Extending views safely: inherit_id, positions, attribute changes, priority, mode='primary' and debugging inheritance.
In this lesson
- Positions and the field shortcut
- Primary mode, priority and group-restricted extensions
- Debugging inheritance errors
Key points
- inherit_id + xpath/field with inside, after, before, replace, attributes, move
- attributes: set, add, remove values
- mode='primary' makes a variant; priority orders extensions
- 'cannot be located in parent view' = XPath didn't match on this version
Real-world example
After upgrading 18→19, a client's invoice form extension failed to apply: the target group had been renamed in the core view. The consultant opened Edit View on 19, found the new name attribute, updated the XPath, and added a test that installs the module to catch it next year.
Questions and answers
What does <attribute name="class" add="text-danger" separator=" "/> do?
Adds a class to the existing class list.
Where do you see all inherited views of a form?
Developer mode → Edit View: Form → Inherited views tab.