Search code examples
xmlodoov8

How to edit button form in position beside the inherited button


i want to position my button beside the inherited button this is my code xml but isnt work i get button under to other

 <record id="holidays_views_form" model="ir.ui.view"> 
        <field name="name">hr.holidays.form</field>
        <field name="type">form</field>
        <field name="model">hr.holidays</field>
        <field name="inherit_id" ref="hr_holidays.edit_holiday_new"/>
        <field name="arch" type="xml">
           <data>
                <header>
                   <xpath expr="//button[@name='refuse']" position="beside">
                    <button string="Retour" name="trainee_canceled_action" states="validate,validate1" type="object" groups=""  />
                  </xpath>
                </header>

enter image description here


Solution

  • Position attribute in Odoo has five options : after, before, replace, inside and attributes :

    You can try below code:

     <record id="holidays_views_form" model="ir.ui.view"> 
        <field name="name">hr.holidays.form</field>
        <field name="type">form</field>
        <field name="model">hr.holidays</field>
        <field name="inherit_id" ref="hr_holidays.edit_holiday_new"/>
        <field name="arch" type="xml">
           <data>
                <header>
                   <xpath expr="//button[@name='refuse']" position="after">
                    <button string="Retour" name="trainee_canceled_action" states="validate,validate1" type="object" groups=""  />
                  </xpath>
                </header>
    

    Bests