vendor_payment_diff_amount/views/account_payment_views.xml

54 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_payment_form_inherit" model="ir.ui.view">
<field name="name">account.payment.form.inherit</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<div name="amount_div" position="after">
<label for="deduction_line_ids" string="Deductions"
invisible="payment_type != 'outbound'"/>
<field name="deduction_line_ids"
invisible="payment_type != 'outbound'"
readonly="state != 'draft'"
nolabel="1">
<tree editable="bottom">
<field name="sequence" widget="handle"/>
<field name="substract_account_id" required="1"/>
<field name="name" placeholder="Description (optional)"/>
<field name="amount_substract" required="1" sum="Total Deductions"/>
<field name="currency_id" column_invisible="1"/>
<field name="company_id" column_invisible="1"/>
</tree>
</field>
<label for="amount_substract" string="Total Deductions"
invisible="payment_type != 'outbound'"/>
<div class="o_row" invisible="payment_type != 'outbound'">
<field name="amount_substract"
widget="monetary"
options="{'currency_field': 'currency_id'}"
readonly="1"
force_save="1"/>
</div>
<label for="final_payment_amount" string="Final Payment Amount"
invisible="payment_type != 'outbound'"/>
<div class="o_row" invisible="payment_type != 'outbound'">
<field name="final_payment_amount"
widget="monetary"
options="{'currency_field': 'currency_id'}"
readonly="1"
force_save="1"/>
<button name="action_fix_amount_calculation"
string="Fix Amount"
type="object"
class="btn-secondary"
invisible="state != 'posted' or not amount_substract"
help="Fix amount calculation if it's incorrect"/>
</div>
</div>
</field>
</record>
</odoo>