Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
13840 Vizualizări

how can i add a custom button to the header section of the res.partner form view  using xml and xpath?

Imagine profil
Abandonează
Cel mai bun răspuns

hello 

You have to inherit the res.partner form and add header tag if not exist.

try like below sample code.

<record id="inherit_res_partner_form" model="ir.ui.view">
    <field name="name">res.partner.form</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_partner_form"/>
    <field name="arch" type="xml">
        <xpath expr="//form//sheet" position="before">
            <header>
                <button name="action_name" string="Text to display" type="button_type"/> # button_type like object/action
            </header>
        </xpath>     </field>
</record>
Imagine profil
Abandonează