Skip to content

[19.0][FIX] l10n_es_vat_book: handle group taxes (e.g. DUA) - #5089

Open
Shide wants to merge 1 commit into
OCA:19.0from
moduon:19.0-fix-vat-book-group-taxes
Open

[19.0][FIX] l10n_es_vat_book: handle group taxes (e.g. DUA)#5089
Shide wants to merge 1 commit into
OCA:19.0from
moduon:19.0-fix-vat-book-group-taxes

Conversation

@Shide

@Shide Shide commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

FWP of #5034

MT-14055 @moduon

@OCA-git-bot OCA-git-bot added series:19.0 mod:l10n_es_vat_book Module l10n_es_vat_book labels Jul 8, 2026

@Gelojr Gelojr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this PR. The fix has been validated successfully. @Shide
The following test was performed:
Test 1: Vendor bill with grouped DUA 21% tax — The VAT Book correctly shows the child tax in the received tax summary with base 1,000.00 and tax amount 210.00 — OK

@rafaelbn

rafaelbn commented Jul 8, 2026

Copy link
Copy Markdown
Member

Hola! @OCA/local-spain-maintainers

  • Antes de este PR: ODOO SERVER ERROR
  • Despúes de este PR: El Libro de IVA se calcula correctamente.

Lo podéis ver aquí en 1 minuto:
https://www.loom.com/share/5205359e4cc84594803a83e75eafbaa5

--
El comentario de "Chatty" 😜

creo que este PR se puede tratar como bugfix acotado, independiente del refactor futuro del Libro de IVA.

El problema es que con impuestos grupo —por ejemplo DUA— _process_aeat_tax_base_info() devuelve res indexado por los impuestos hijos, pero upsert_book_line_tax() intenta leer res[tax] usando el impuesto grupo original. Eso provoca el KeyError.

Este cambio no cambia la arquitectura del libro: solo consume el resultado real de los helpers AEAT. Está cubierto por test y validado funcionalmente.

Además, el mismo patrón sigue en 18.0 y 19.0, así que podemos mezclar también #5034

¿Lo veis razonable para mergear como fix puntual?

Saludos

@rafaelbn rafaelbn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probado funcionalmente 👍🏼

Resuelve un Odoo Server Error cuando tienes DUA

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

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.

5 participants