View inheritance
Instead of modifying existing views (by overwriting them), Odoo provides view inheritance when child views of the "extension" are applied on top of the root views and can add or remove content from their parent.
, inherit_id, xpath, :
<record id="idea_category_list2" model="ir.ui.view">
<field name="name">id.category.list2</field>
<field name="model">idea.category</field>
<field name="inherit_id" ref="id_category_list"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='description']" position="after">
<field name="idea_ids" string="Number of ideas"/>
</xpath>
</field>
</record>
XPath, . , ,
Operation to apply to the matched element:
inside
appends xpath body at the end of the matched element
replace
replaces the matched element by the xpath body
before
inserts the xpath body as a sibling before the matched element
after
inserts the xpaths body as a sibling after the matched element
attributes
alters the attributes of the matched element using special attribute elements in the xpath body
position , . .
<xpath expr="//field[@name='description']" position="after">
<field name="idea_ids" />
</xpath>
<field name="description" position="after">
<field name="idea_ids" />
</field>
.