Skip to content

[19.0][MIG] partner_data_vies_populator: Migration to 19.0 - #2558

Open
dreispt wants to merge 24 commits into
OCA:19.0from
dreispt:19.0-mig-partner_data_vies_populator
Open

dreispt wants to merge 24 commits into
OCA:19.0from
dreispt:19.0-mig-partner_data_vies_populator

Conversation

@dreispt

@dreispt dreispt commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Migration of partner_data_vies_populator to 19.0, carrying forward the module history from #2373 (18.0 migration).

Changes

  • Bump version to 19.0.1.0.0
  • Use lazy %s logging interpolation instead of f-strings
  • Use env-based translation (self.env._) per Odoo 19 linting conventions
  • Regenerate README and index.html for 19.0

Post-migration changes

  • [FIX] don't crash on VIES record without address — VIES can return a valid record with address unset; _parse_vies_address crashed on None.split(). Guard falsy and "---" addresses.
  • [IMP] populate partner data on create/write — the VIES lookup only ran from the form onchange, so imports, RPC and integration flows never populated partner data. Run it from create/write too, guarded against recursion via the no_vies_populate context key, and show a toast notification on each lookup result (success / no data / failure). The VAT is normalized through base_vat._run_vat_checks first: unprefixed numbers for EU prefix countries get their country prefix, and malformed or non-EU numbers are skipped silently instead of warning on every partner save.
  • [FIX] tolerate VIES dates with timezone — VIES returns requestDate as an xsd:date carrying a timezone offset (e.g. 2026-11-20+01:00), which isodate.parse_date rejects; zeep logged "Error during xml -> python translation" on every call. Apply the tolerant parse in the module (the workaround previously lived only in tests) and declare zeep, the SOAP client python-stdnum uses for the VIES calls, as an explicit dependency.

Compatibility notes

No API changes were needed: res.partner._split_vat, stdnum.eu.vat.check_vies, and the onchange mechanism are unchanged in 19.0.

Odoo 19's base_vat now performs its own native VIES validation through IAP (_check_vies_iap / vies_valid). This module remains complementary — it populates name/address/country on VAT change, which the native check does not do. In tests, the native IAP check attempts are blocked by the test HTTP layer and logged as VIES check: call to IAP failed; they are non-fatal and all tests pass.

Tests

  • 0 failed, 0 error(s) of 9 tests on Odoo 19.0 (real database, base_vat installed)
  • pre-commit passes (Ruff, Ruff format, pylint, pylint-odoo)

Assisted-by: Devin:SWE-2 High

feketemihai and others added 21 commits November 19, 2026 20:41
Improve error handling to avoid crash when Internet connectivity is down
Read country code from VIES, not from VAT number
No update when VAT number is invalid
Improve tests
Currently translated at 100.0% (5 of 5 strings)

Translation: partner-contact-14.0/partner-contact-14.0-partner_data_vies_populator
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_data_vies_populator/fr/
- Bump version to 19.0.1.0.0
- Use lazy %s logging interpolation instead of f-strings
- Use env-based translation (self.env._) per Odoo 19 conventions
- Regenerate README and index.html for 19.0

No API changes needed: _split_vat, stdnum.eu.vat.check_vies and the
res.partner onchange mechanism are unchanged in 19.0.

Assisted-by: Devin:SWE-2 High
@oca-cla-bot

oca-cla-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@OCA-git-bot OCA-git-bot added series:19.0 mod:partner_data_vies_populator Module partner_data_vies_populator labels Nov 19, 2026
… address

VIES can return a valid VAT entry with a name but no address (or an
empty one). _parse_vies_address was called unconditionally in that case,
raising AttributeError on None.split() and killing the onchange.

Guard on falsy address values, which also avoids overwriting street
with an empty string.

Assisted-by: Devin:SWE-2 High
@dreispt
dreispt force-pushed the 19.0-mig-partner_data_vies_populator branch 3 times, most recently from 0b2778c to 177b847 Compare November 21, 2026 11:16
The VIES lookup only ran from the form onchange, so imports, RPC and
other integration flows never populated partner data. Run it from
create and write as well, guarded against recursion, and notify the
user with a toast on each lookup result. Normalize the VAT through
base_vat._run_vat_checks first: unprefixed numbers for EU prefix
countries get their country prefix, and malformed or non-EU numbers
are skipped silently instead of warning on every partner save.

Assisted-by: Devin:SWE-2 High
VIES returns requestDate as an xsd:date carrying a timezone offset
(e.g. '2026-11-20+01:00'), which isodate.parse_date rejects. zeep logs
an "Error during xml -> python translation" error on every VIES call
before falling back to the raw string. The previous workaround patched
isodate only inside the test suite; apply it in the module instead and
drop the duplicate from the tests. Declare zeep as an explicit
dependency, since it is the SOAP client python-stdnum uses for the
VIES API calls.

Assisted-by: Devin:SWE-2 High
@dreispt
dreispt force-pushed the 19.0-mig-partner_data_vies_populator branch from 177b847 to 5895803 Compare November 21, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:partner_data_vies_populator Module partner_data_vies_populator series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants