Skip to content

[14.0][IMP] l10n_es_extension: add the generic non-deductible VAT family - #953

Open
eantones wants to merge 3 commits into
14.0from
14.0-imp-l10n_es_extension-nd_taxes
Open

[14.0][IMP] l10n_es_extension: add the generic non-deductible VAT family#953
eantones wants to merge 3 commits into
14.0from
14.0-imp-l10n_es_extension-nd_taxes

Conversation

@eantones

@eantones eantones commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Add the complete non-deductible input VAT family the official l10n_es does not ship: the goods variants (bienes corrientes / bienes de inversión) of the official 4%, 10% and 21% templates (the 21% keeps the official's historical p_iva0_nd naming) and the nine intra-community / reverse-charge non-deductible templates.
  • Move the name overrides of the four official non-deductible templates (4%, 5%, 10%, 21%) here.
  • Plug the family into the official fiscal positions the same way l10n_es_special_prorate plugs its prorate taxes: intra-community (9 lines), IRPF 15 (6 lines) and, in the second commit, the TAI "no sujeto por reglas de localización" position (9 lines).
  • The 14.0.3.0.0 migration materializes this module's mapping lines on the fiscal positions of already-existing companies (template lines only flow through the chart wizard). It resolves instantiated records by terminal xml-id name, so it works during the custody handover from oxigensalud/odoo-addons (see the paired PR) and on any generic database.

The tax and mapping records are a faithful copy of the ones oxigensalud/odoo-addons (oxigen_l10n_es) declared until now — they were born there, but they are generic to the Spanish localization, not client customizations. The terminal xml-id names are kept identical on purpose: the paired oxigen_l10n_es migration hands the existing records over in place, and the template synchronization of later Odoo versions pairs records by name.

Pairs with oxigensalud/odoo-addons#217. This PR must be merged first (or together): the other side depends on this module declaring the family.

Test plan

eantones added 2 commits July 23, 2026 18:38
The goods variants (bienes corrientes / bienes de inversion) and the
intra-community / reverse-charge cases of the non-deductible input VAT
are generic to the Spanish localization, but the official l10n_es only
ships the four servicios corrientes templates (4%, 5%, 10% and 21% --
the latter under its historical xml-id p_iva0_nd). Declare the missing
family here: 15 tax templates, the name overrides of the four official
ones, and the mapping lines that plug them into the official
intra-community and IRPF 15 fiscal positions, following the same
pattern l10n_es_special_prorate uses for its prorate taxes.

The records are a faithful copy of the ones oxigen_l10n_es declared
until now (they were born there in 2022, but they are not
client-specific). The terminal xml-id names are kept identical on
purpose: the oxigen_l10n_es 14.0.1.1.0 migration relies on them to
hand over the existing records in place, and the template
synchronization of later Odoo versions pairs records by name.
…ition

The official 'No sujeto por reglas de localizacion (TAI)' fiscal
position only maps the deductible taxes to their no-sujeto
counterparts; the non-deductible family must fall the same way. Add
the nine mapping lines (servicios / bienes corrientes / bienes de
inversion at 4%, 10% and 21%) to the official position template.

Template mapping lines only reach companies through the chart wizard,
so the migration materializes the missing lines of this module on the
fiscal positions of existing companies, resolving the instantiated
records by terminal xml-id name so a concurrent module handover of the
tax custody does not break the lookup. Companies or taxes not
instantiated are skipped with a log line: completing a partial chart
remains the wizard's job.
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.46%. Comparing base (915c841) to head (64cfa94).

Additional details and impacted files
@@            Coverage Diff             @@
##             14.0     #953      +/-   ##
==========================================
- Coverage   51.47%   51.46%   -0.01%     
==========================================
  Files        1182     1182              
  Lines       20438    20438              
  Branches     4299     4299              
==========================================
- Hits        10520    10518       -2     
- Misses       9661     9662       +1     
- Partials      257      258       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

eantones added a commit to oxigensalud/odoo-addons that referenced this pull request Jul 23, 2026
Resolve l10n_es_extension from nuobit/odoo-addons#953 while the
non-deductible family handover is under review there: oxigen_l10n_es
now references the family under that module, so CI needs the paired
branch. The pull ref keeps resolving after the merge; the line can go
back to the branch pin once #953 lands.
@eantones eantones added hold merge no merge before Oxigen 18 Do not merge until Oxigen is live in production on 18.0 (migration cutover). and removed hold merge labels Jul 23, 2026
@eantones
eantones marked this pull request as ready for review July 23, 2026 20:15
A company holding p_iva4_sp_ex with its two TAX repartition lines in the
reverse order of the l10n_es template trips the order-sensitive core
update_taxes_from_templates check at the next major-version hop: the tax
is judged "different", loses its xml-id and is forked into "[old] ..."
plus a fresh duplicate. The 14.0.3.1.0 migration bumps sequence=2 on the
+100% TAX line so the effective (sequence, id) order matches the template
(base, -100, +100) and the tax stays template-managed. It touches only
the ordering field -- no amounts, accounts, tags or rows -- is idempotent
and tolerant of installs without the tax.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no merge before Oxigen 18 Do not merge until Oxigen is live in production on 18.0 (migration cutover).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant