Extending views
Forms, lists, and search views are defined using the arch
XML structures. To extend views, we need a way to modify this XML. This means locating XML elements and then introducing modifications at those points.
Inherited views allow just that. An inherited view declaration looks like this:
<record id="view_form_todo_task_inherited" model="ir.ui.view"> <field name="name">Todo Task form - User extension</field> <field name="model">todo.task</field> <field name="inherit_id" ref="todo_app.view_form_todo_task"/> <field name="arch" type="xml"> <!-- ...match and extend elements here! ... --> </field </record>
The inherit_id
field identifies the view to be extended by referring to its external identifier using the special ref
attribute. External ...
Get Odoo 10 Development Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.