如何在继承按钮旁边的位置编辑按钮表单

时间:2016-10-27 08:47:50

标签: xml openerp v8

我想把我的按钮放在继承的按钮旁边这是我的代码xml但不工作我得到按钮下面的其他

 <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

1 个答案:

答案 0 :(得分:2)

Odoo中的排名属性有五个选项:afterbeforereplaceinsideattributes

您可以尝试以下代码:

 <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>

贝斯茨