Skip to content

[16.0][ADD] pms,pms_l10n_es: res.partner.get_vat()#397

Merged
OCA-git-bot merged 2 commits into
OCA:16.0from
commitsun:16.0-add-res_partner-get_vat
May 11, 2026
Merged

[16.0][ADD] pms,pms_l10n_es: res.partner.get_vat()#397
OCA-git-bot merged 2 commits into
OCA:16.0from
commitsun:16.0-add-res_partner-get_vat

Conversation

@jesusVMayor
Copy link
Copy Markdown
Member

Add res.partner.get_vat() on pms returning the VAT field, with an override in pms_l10n_es that returns aeat_identification when aeat_identification_type is set. Mirrors the priority of l10n_es_aeat._parse_aeat_vat_info.

Single canonical entry point for PMS consumers (reports, exporters, FastAPI schemas) that need the partner fiscal identifier without hardcoding the VAT/AEAT dual.

Add a get_vat() method on res.partner returning the VAT field.

This is a template helper meant to be overridden by localization
modules to return the country-specific fiscal identifier when the
partner is identified by a non-VAT document. PMS deployments often
invoice non-VAT-registered guests (passport, residence permit, etc.)
and need a single canonical entry point so reports, exporters and
APIs do not duplicate the resolution logic.
Override res.partner.get_vat() to return aeat_identification when
aeat_identification_type is set, falling back to the parent VAT
otherwise. Mirrors the priority of l10n_es_aeat _parse_aeat_vat_info,
where alternative AEAT identifications (passport, residence permit,
other document) supersede the VAT field for fiscal reporting.
@jesusVMayor jesusVMayor force-pushed the 16.0-add-res_partner-get_vat branch from e59df7c to 08add7f Compare May 8, 2026 11:36
@DarioLodeiros
Copy link
Copy Markdown
Member

/ocabot merge minor

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-397-by-DarioLodeiros-bump-minor, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

It looks like something changed on 16.0 in the meantime.
Let me try again (no action is required from you).
Prepared branch 16.0-ocabot-merge-pr-397-by-DarioLodeiros-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit eb9c2f7 into OCA:16.0 May 11, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 45cdcd5. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants