flectra/addons/account_discount/views/account_invoice_views.xml

24 lines
1.5 KiB
XML
Raw Normal View History

2018-01-11 06:22:40 +01:00
<?xml version="1.0" encoding="utf-8"?>
<flectra>
<!-- Account -->
<record model="ir.ui.view" id="inherit_account_invoice_form">
<field name="name">account.invoice.inherit.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='left_panel']" position="inside">
<separator string="Discount"/>
<field name="discount_method" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="discount_amount" attrs="{'readonly': [('state', '!=', 'draft'), ('discount_method', '=', False)], 'invisible': [('discount_method', '=', 'per')]}"/>
<field name="discount_per" attrs="{'invisible': ['|', ('discount_method', '=', 'fixed'), ('discount_method', '=', False)], 'readonly': [('state', '!=', 'draft')]}"/>
<button name="calculate_discount" type="object" class="oe_edit_only oe_link" string="(Update Discount)" attrs="{'invisible': [('discount_method', '=', False)]}" confirm="If you want to apply global discount other discount methods will be reset."/>
2018-01-11 06:22:40 +01:00
</xpath>
<xpath expr="//field[@name='amount_untaxed']" position="before">
<field name="gross_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
2018-01-11 06:22:40 +01:00
<field name="discount" string="Discount"/>
</xpath>
2018-01-11 06:22:40 +01:00
</field>
</record>
</flectra>