我想把我的按钮放在继承的按钮旁边这是我的代码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>
答案 0 :(得分:2)
Odoo中的排名属性有五个选项:after
,before
,replace
,inside
和attributes
:
您可以尝试以下代码:
<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>
贝斯茨