[FIX] sale_timesheet: avoid adding buttonbox on invoices

- Instead of adding the "timesheet" statbutton on the invoice's
buttonbox, this inherit view is adding a new buttonbox which causes
conflict with the original buttonbox.
This commit is contained in:
Toufik Benjaa
2018-08-14 16:45:51 +02:00
parent ea154d283e
commit 4f69be7ead
@@ -15,12 +15,10 @@
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//label" position="before">
<div class="oe_button_box" name="button_box" groups="base.group_user">
<button name="%(sale_timesheet.action_timesheet_from_invoice)d" type="action" class="oe_stat_button" icon="fa-calendar" attrs="{'invisible':[('timesheet_count','=', 0)]}">
<field name="timesheet_count" widget="statinfo" string="Timesheets"/>
</button>
</div>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(sale_timesheet.action_timesheet_from_invoice)d" type="action" class="oe_stat_button" icon="fa-calendar" attrs="{'invisible':[('timesheet_count','=', 0)]}">
<field name="timesheet_count" widget="statinfo" string="Timesheets"/>
</button>
</xpath>
</field>
</record>