flectra/addons/account_discount/views/account_invoice_views.xml

24 lines
1.5 KiB
XML

<?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."/>
</xpath>
<xpath expr="//field[@name='amount_untaxed']" position="before">
<field name="gross_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="discount" string="Discount"/>
</xpath>
</field>
</record>
</flectra>