On certain v16 instances, although the partner bank account that is
being pre-set in the account.payment creation values dictionary:
https://github.com/OCA/bank-payment/blob/fc7783669f40d85/account_payment_order/models/account_payment_line.py#L206
it's being marked as dirty (it's a computed writable field), and thus,
being recomputed before being saved, getting an invalid value (on
direct debits, the company's bank account).
The triggers that lead to this situation are unknown due to the low
level where it's happening and the tons of interactions being taken in
place, so the best way to deal with this is to override the compute
method that computes this value, so even if the field is recomputed, it
gets the correct value.
Let's be pragmatic...
TT50804
For propagating maturity dates from the individual payment moves to the
grouped ones, 2 actions are taken:
- For the counterpart that will neutralize each payment, we put the
maturity date according to the same logic as the payment one.
- For the grouped AR/AP, we put the first payment date of all the
grouped payments, as all of them should be the same after grouping
by this criterium in _prepare_trf_moves.
TT50671
When a payment reference (field `payment_reference`) is provided on the vendor bill, it should be used in priority over the vendor bill number (field `ref`).
One reason is that the `ref` field is different for each invoice of the same supplier (it is used in Odoo's standard duplicate warning),
but the payment reference maybe the same for all payments to the
same supplier. For instance some suppliers request that the customer
id is used on the payment communication and it is the same on
all their invoices.
Another reason is that some supplier use a structured payment communication scheme, and that one only makes sense in
the payment_reference field.
The payment line reference type takes its value from the invoice reference
type, and both fields must have the same options.
The missing option "structured" causes a bug during payment creation.
the test is modified to be able to reproduce the problem.
Compatibility with https://github.com/OCA/bank-payment/pull/1304
The payment (account.payment) and the account entry (account.move) are defined with today's date,
but the "important" date is the date of the line, therefore the payment_line_date field is created.
The modules account_banking_sepa_sepa_direct_debit + account_banking_sepa_credit_transfer
to use the payment_line_date field.
TT49988
In v13 the existing behavior was defined with today's date the Transfer Move, therefore, we define
that behavior by default without configuration since it is the expected behavior.
https://github.com/OCA/bank-payment/pull/805/files
TT49582