Files
odoo_source/addons/l10n_latam_check
Nshimiyimana Séna 5d5c3f2151 [FIX] l10n_latam_check, account_check_printing: ensure third party check number are numeric
Summary
-------
Currently, when `l10n_latam_check` is installed, third party checks'
number can be non-numeric.

Steps to reproduce
------------------
* install  `l10n_latam_check`, and `l10n_ar`
* switch to an Argentinean company
* create and validate an invoice
* register a payment for that invoice using:
  - Journal: Third Party Checks
  - Check Number: anything that's not a number

The payment is created without issue, but it shouldn't. This ends up
causing tracebacks elsewhere because we expect the check number to only
contain digits.

Cause
-----
The `l10n_latam_check` module overrides `_constrains_check_number`, to
disable it on third party checks. The goal is to allow third party check
numbers to be non-unique. However, the code that checks whether the
`check_number` value only contains digits is in the same method. This
means that by skipping the uniqueness check, the code also skips the
value check.

Fix
---
This commit splits `_constrains_check_number` into two methods (one for
checking the value, and the other for uniqueness), and modifies
`l10n_latam_check` to override the uniqueness check only.

opw-3464012

closes odoo/odoo#141371

X-original-commit: 3e7b1f014af9b34473fe6eba07bc051b38a74c72
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-11-07 06:07:01 +00:00
..
…
…