Add ir.model.button record.

This commit is contained in:
Albert Cervera i Areny 2019-12-05 12:11:40 +01:00
parent b41ee857f2
commit ccb3cdc458
3 changed files with 14 additions and 7 deletions

View file

@ -38,6 +38,7 @@ class Sale(metaclass=PoolMeta):
| (Eval('state') == 'cancel')),
'readonly': ~Eval('groups', []).contains(
Id('sale', 'group_sale')),
'icon': 'tryton-forward',
},
})

View file

@ -33,6 +33,16 @@
<field name="perm_delete" eval="False"/>
</record>
<record model="ir.model.button" id="sale_handle_production_exception_button">
<field name="name">handle_production_exception</field>
<field name="string">Handle Production Exception</field>
<field name="model" search="[('model', '=', 'sale.sale')]"/>
</record>
<record model="ir.model.button-res.group" id="sale_handle_production_exception_button_group_sale">
<field name="button" ref="sale_handle_production_exception_button"/>
<field name="group" ref="sale.group_sale"/>
</record>
<!-- sale.handle.production.exception -->
<record model="ir.action.wizard" id="wizard_production_handle_exception">
<field name="name">Handle Production Exception</field>

View file

@ -2,16 +2,12 @@
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<data>
<xpath expr="/form/notebook/page[@id='sale']/group[@id='states']/field[@name='invoice_state']"
position="after">
<xpath expr="/form/notebook/page[@id='sale']/group[@id='states']/field[@name='invoice_state']" position="after">
<label name="production_state"/>
<field name="production_state"/>
</xpath>
<xpath expr="/form/notebook/page[@id='sale']/group[@id='amount_buttons']/group/button[@name='handle_invoice_exception']"
position="after">
<button name="handle_production_exception"
string="Handle Production Exception"
icon="tryton-forward"/>
<xpath expr="/form/group[@id='buttons']/button[@name='handle_invoice_exception']" position="after">
<button name="handle_production_exception"/>
</xpath>
<xpath expr="/form/notebook/page[@name='invoices']" position="after">
<page string="Productions" id="productions">