Skip to content
Snippets Groups Projects
user avatar
Nicolas Martinelli authored
- Activate the VIES online check
- Create a partner of type Company and add several contacts
- Set the VAT number, save

A call to VIES is done for each contact.

The field VAT is propagated from the parent company to the children,
triggering the check on all partners. This is not problematic for local
checks since those are fast. However, online checks take time which can
lead to a timeout of the request if there are many contacts.

Since the check is triggered through a constraint (`check_vat`), only
one record at a time is checked. Therefore, it is not possible to build
a local list of the VAT numbers to avoid duplicated verifications inside
a single transaction.

The solution is to store the result in cache. Since the call to the
external API may fail (e.g. timeout), we extract the check to store only
the successful calls.

Closes #43939
opw-2181744

closes odoo/odoo#44298

X-original-commit: 0c7a3e95
Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
ba3062e6
History
Name Last commit Last update