Extending views and data
Views and other data components can also be modified by an extension module. For views, the case is usually to add features. The view presentation structure is defined with XML. To extend this XML, we must locate the node to extend and then declare the action to perform there, such as inserting additional XML elements.
The other data elements represent records that were written to the database. Extension modules can write on them to change some values.
Extending views
Views are defined using XML and are stored in the architecture field, arch
. To extend a view, we must locate the node where the extension will take place, and then perform the intended change, such as adding XML elements.
Odoo provides a simplified notation to extend XML by using the XML tag we want to match – <field>
, for example – with one or more distinctive attributes to match, such as name
. Then, we must add the position
attribute to declare the...