Files
odoo_source/addons/l10n_latam_check
Arnaud Sibille c64b45b468 [FIX] account: add constrains on payment method line journal
When you create or register a payment, the domain of the payment method
lines is based on a computed field dependent of the selected journal.
The issue is that the interface isn't blocked when waiting for the
onchange return.  So if the user changes the journal, then select the
payment method quickly enough while the onchange is still pending, he
will be able to select outdated values.

It is a limitation of the js framework, so to avoid the user encoding
wrong datas, the fix here is to raise a `ValidationError` telling to
re-select the payment method.

To reproduce:
- create second bank journal, with outbound payment method lines having
different names than the ones of the first bank journal (in order to
distinct them).
- slow down the `_compute_payment_method_line_fields` method
- create a vendor payment, switch the journal to the one created and
select the second payment method (before the onchange ends).
- save the payment.
-> The payment has a payment method line from a different journal

opw-3587241

closes odoo/odoo#157872

X-original-commit: 65395bb670ec1dcf534588504057a03513cb94f6
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Arnaud Sibille (arsi) <arsi@odoo.com>
2024-03-15 18:42:49 +00:00
..
…
…