How to add a title to a form that is already defined in Odoo?

Is it possible to inherit the form view and add a title to it? I tried:

<field name="arch" type="xml"> <xpath expr="//form" position="before"> <header> <h1>hi</h1> </header> </xpath> </field> 

and

 <form position="inside"> <header> <h1>hi</h1> </header> </form> 

What can I do? I want to add buttons to the form beautifully, without having to redefine the entire form.

+6
source share
2 answers
 <xpath expr="/form/*" position="before"> <header> <h1>hi</h1> </header> </xpath> 

Note that for the parent form this should not be empty.

+3
source

This will take the current heading and then replace it with the heading that you define here.

 <xpath expr="//form/header" position="replace"> <header> <h1>hi</h1> </header> </xpath> 
+1
source

Source: https://habr.com/ru/post/979500/


All Articles