mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
This field was editable in previous version before invoice > move refactoring, and it's logic to allow to change payment mode once the invoice has been posted without the need of resetting it to draft. Thus, the field has been changed to computed writable field, taking care of the consequences at model level (compute) and view level (add the field in views + proper attrs). This commits adds tracking=True to the payment mode field as well to be aware when and who the payment mode is changed in the invoice, no matter if directly changed in draft, or through the change on the journal item. TT39850
45 lines
2.1 KiB
XML
45 lines
2.1 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!--
|
|
Copyright 2016 Akretion (http://www.akretion.com/)
|
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
-->
|
|
<odoo>
|
|
<record id="view_move_line_form" model="ir.ui.view">
|
|
<field name="name">account_payment_partner.move_line_form</field>
|
|
<field name="model">account.move.line</field>
|
|
<field name="inherit_id" ref="account.view_move_line_form" />
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='analytic_distribution']/.." position="after">
|
|
<group name="payments" string="Payments">
|
|
<field name="account_type" invisible="1" />
|
|
<field name="reconciled" invisible="1" />
|
|
<field
|
|
name="payment_mode_id"
|
|
widget="selection"
|
|
force_save="1"
|
|
attrs="{'invisible': [('account_type', 'not in', ['asset_receivable', 'liability_payable'])], 'readonly': ['|', ('account_type', 'not in', ['asset_receivable', 'liability_payable']), ('reconciled', '=', True)]}"
|
|
/>
|
|
</group>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
<record id="view_move_line_tree" model="ir.ui.view">
|
|
<field name="name">account.move.line.tree - Add payment mode</field>
|
|
<field name="model">account.move.line</field>
|
|
<field name="inherit_id" ref="account.view_move_line_tree" />
|
|
<field name="arch" type="xml">
|
|
<field name="date_maturity" position="after">
|
|
<field name="account_type" invisible="1" />
|
|
<field name="reconciled" invisible="1" />
|
|
<field
|
|
name="payment_mode_id"
|
|
optional="hide"
|
|
widget="selection"
|
|
force_save="1"
|
|
attrs="{'invisible': [('account_type', 'not in', ['asset_receivable', 'liability_payable'])], 'readonly': ['|', ('account_type', 'not in', ['asset_receivable', 'liability_payable']), ('reconciled', '=', True)]}"
|
|
/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
</odoo>
|