- Create setUpClass method
- Switch to setUpClass (if needed) for avoiding repeat the same setup for each test.
- Include context keys for avoiding mail operations overhead.
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
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
Odoo core already includes a mechanism, only activated in enterprise,
to mark invoices reconciled against a payment as "In payment", not as
"Paid", and then when the bank reconciliation is done, passed to "Paid".
As we already refactored the payment order transfer entries generation
to be done by payments, the only missing bits is to override the method
that returns the payment state to put.
We have limited this new payment state though to those invoices that
are part of a payment order, not all including those which were paid
pressing the button "Register payment", as that's out of the scope
of this module.
TT49386