Files
bank-payment/account_payment_order/views/account_invoice_view.xml
Alexis de Lattre dc8dd37f0e [IMP] account_payment_order: computation of sepa + remove done state + UI adjustments
- Improve computation of sepa on account.payment.order: check IBAN is in SEPA zone
  Update move line generation to get transfer account from bank journal
  Update payment mode configuration accordingly (3 fields removed)
  Several improvements in payment order tree and form view
- Remove done state (migration script provided)
- Don't set reference_type field on account.move required=True, because it
  causes a lot of problems in other modules that don't depend on this one.
  Setting it as required in the view is enough.
- add optional="hide" on payment mode in invoice tree view
- FIX crash when communication=null on payment line
- payment_mode_id readonly when state != draft
2023-03-04 19:44:00 +01:00

83 lines
3.9 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_form" model="ir.ui.view">
<field name="name">account_payment_order.view_move_form</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account_payment_partner.view_move_form" />
<field name="arch" type="xml">
<button id="account_invoice_payment_btn" position="after">
<!-- For customer refunds:
'Add to Direct Debit Order' will deduct the refund from a customer invoice
We could also need a button 'Add to Payment Order' to reimburse
a customer via wire transfer... but I prefer to keep things
simple ; to do that, the user should manually create a payment order
and select the move lines -->
<button
name="create_account_payment_line"
type="object"
string="Add to Debit Order"
groups="account_payment_order.group_account_payment"
attrs="{'invisible': ['|', '|',
('payment_order_ok', '=', False),
('state', '!=', 'posted'),
('move_type', 'not in', ('out_invoice', 'out_refund'))
]}"
/>
<button
name="create_account_payment_line"
type="object"
string="Add to Payment Order"
groups="account_payment_order.group_account_payment"
attrs="{'invisible': ['|', '|',
('payment_order_ok', '=', False),
('state', '!=', 'posted'),
('move_type', 'not in', ('in_invoice', 'in_refund'))
]}"
/>
</button>
<field name="payment_mode_id" position="after">
<field name="payment_order_ok" invisible="1" />
</field>
<field name="payment_reference" position="before">
<field
name="reference_type"
required="1"
attrs="{'readonly':[('state','!=','draft')],
'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"
/>
</field>
</field>
</record>
<record
id="account_invoice_create_account_payment_line_action"
model="ir.actions.act_window"
>
<field name="name">Add to Payment/Debit Order</field>
<field name="res_model">account.invoice.payment.line.multi</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id" ref="account.model_account_move" />
</record>
<record id="view_invoice_tree" model="ir.ui.view">
<field name="name">account_payment_order.view_invoice_tree</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_invoice_tree" />
<field name="arch" type="xml">
<button name="action_register_payment" position="after">
<button
name="%(account_invoice_create_account_payment_line_action)d"
type="action"
string="Add to Payment/Debit Order"
groups="account_payment_order.group_account_payment"
invisible="context.get('default_move_type') not in ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')"
/>
</button>
</field>
</record>
</odoo>