Skip to content

[19.0][MIG] l10n_es_aeat_sii_oca - #4956

Merged
OCA-git-bot merged 377 commits into
OCA:19.0from
moduon:19.0-mig-l10n_es_aeat_sii_oca
Jun 13, 2026
Merged

[19.0][MIG] l10n_es_aeat_sii_oca#4956
OCA-git-bot merged 377 commits into
OCA:19.0from
moduon:19.0-mig-l10n_es_aeat_sii_oca

Conversation

@EmilioPascual

Copy link
Copy Markdown
Contributor

MT-14051 @moduon

@OCA-git-bot OCA-git-bot added series:19.0 mod:l10n_es_aeat_sii_oca Module l10n_es_aeat_sii_oca labels Apr 15, 2026
@EmilioPascual
EmilioPascual force-pushed the 19.0-mig-l10n_es_aeat_sii_oca branch from 81840f9 to 8243950 Compare April 15, 2026 16:43
@HaraldPanten

Copy link
Copy Markdown
Contributor

/ocabot migration l10n_es_aeat_sii_oca

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Apr 17, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Apr 17, 2026
40 tasks
@EmilioPascual
EmilioPascual force-pushed the 19.0-mig-l10n_es_aeat_sii_oca branch from f2e4526 to 31055e4 Compare April 27, 2026 07:01

@ArantxaSudon ArantxaSudon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revisión Funcional

Activando en la compañía el SII y rellenando las claves de las posiciones fiscales, se rellenan correctamente en las facturas y se envían al SII

@moduon MT-14051

@Shide Shide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revisión de código.
Super buen trabajo.
Solo unas cuantas dudas y otras sugerencias no bloqueantes

Comment thread l10n_es_aeat_sii_oca/models/account_move.py Outdated
Comment thread l10n_es_aeat_sii_oca/models/account_move.py
Comment thread l10n_es_aeat_sii_oca/models/sii_mixin.py
Comment thread l10n_es_aeat_sii_oca/models/sii_mixin.py Outdated
Comment thread l10n_es_aeat_sii_oca/tests/test_l10n_es_aeat_sii.py
pedrobaeza and others added 21 commits May 20, 2026 16:28
These were not working since odoo/odoo@5b61898a,
so this fixes this.

Translation: l10n-spain-12.0/l10n-spain-12.0-l10n_es_aeat_sii
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-l10n_es_aeat_sii/
Previous method was comparing 2 strings for equality, but coming from dictionaries,
the generated strings may be different, as the order is not guaranteed in
<= Python 3.5.

We can use Python dictionary comparison instead for accurated results.

The method name has also been changed for reflecting the real semantics of it.

TT25025
Since odoo/odoo#34044, VAT not subject for goods was not included in any SII taxes
map, which provokes that any vendor bill of this type is not correctly sent.
If there's an accounting date, taxes amounts in company currency are not properly
computed.

The method has been refactored as well for using the modern `_convert` method.
You can have default invoice type expressed in the context key `default_type`, so
we have to check that as well.
This refactoring is made for reducing code and do it even more readable, but
esentially for a later improvement that will come for grouping taxes with same
percentage.
If not merged, we may rebase the limit of 6 maximum blocks of this type. This can
happen when using several types of VAT taxes (goods/services) in the same invoice,
or not deductible VAT with different analytic accounts.

TT25683
Don't assign a fixed refund specific type for avoiding problems in refunds of
simplified invoices
…s de proveedor

- Añadido aeat.sii.map.lines para NotIncludedInTotal
- facturas emitidas irpf
- Don't process again everything, but do it inline on existing methods
- Make tests resilient
- Redo the tax computation for efficiency and reliability
- Add test suite for checking obtained JSON for different tax configurations
- SII description computation reworked for new computed writable
- Added migration scripts
For avoiding collapse on Odoo Apps Store.
On taxes with no amount ("IVA soportado exento" for example), the key `amount` is not
filled, provoking a problem sending it to SII.

We avoid it initializing full expected dictionary structure on first occurrence.

This commit also contains a little fix for avoiding the crash of `merge_dict` method
not having "TipoImpositivo" key in the dictionaries.
pedrobaeza and others added 15 commits May 20, 2026 16:29
After not doing breakdown, a problem has been discovered if there are
2 taxes of the same percentage, like 21% services and 21% goods.

For solving it, we move the `_merge_tax_dict` auxiliar method to the
mixin, and using it for the out taxes dictionary generation.

It includes an extra JSON file for tests for exercizing the problem.
If a line with the ISP tax comes before one with non ISP tax, the
dictionary is sent with S2 instead of S3. That's because the switch to
S3 was only performed in one place, assuming that the ISP tax will come
second. Now it's checked in both places.

This includes a little refactor for better readability.
If not, the error is reraised, and the SII sending in batch is aborted,
so the rest of the invoices are not ever send meanwhile.

Looking for the roots of this code, it was introduced when extracting
the SII mixin:

OCA@4e2dee2

but not related to it, and the comment of the justification doesn't
seem correct. This raise was previously captured by the second existing
try, that was provoking another problem and removed in OCA#4807.

As now the dict may not exist, we adapt the exception save to that
condition.

TT61482
En este PR se añaden las siguientes mejoras:

* Si la factura está en error, al enviarla de nuevo se crea como envío
  inmediato.

  * Esto sobretodo es para evitar que lleguemos al límite de tiempo si
    la corrección se realiza más tarde y tenemos retardo de días.

* El check de error ahora es readonly.

  * Esto solo debería ser modificado desde el código.

* Muestreo en el dashboard de los diarios si existen facturas con error
  con enlace directo.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-18.0/l10n-spain-18.0-l10n_es_aeat_sii_oca
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_aeat_sii_oca/
…Inversion values

When a supplier invoice has multiple tax lines with the same tax rate
(TipoImpositivo) but some are investment goods (BienInversion=S) and others
are not, they should NOT be merged into a single SII entry.

This fixes the bug where all tax lines were incorrectly marked as investment
goods when the first tax line had BienInversion=S.

MT-14523 @moduon
@rafaelbn

rafaelbn commented Jun 6, 2026

Copy link
Copy Markdown
Member

Hola @OCA/local-spain-maintainers ! ¿Necesitáis algo más para proceder al merge de este PR? Muchas gracias! Saludos

@HaraldPanten

Copy link
Copy Markdown
Contributor

@rafaelbn Si podéis conseguir alguna review más de otros contribuidores, de otras empresas, eso ayudará seguro 💪.

@marcosSaucedoQubiq marcosSaucedoQubiq 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.

He probado los cambios incluidos en la migración realizando validaciones funcionales sobre los principales flujos del módulo. LGTM. ✅

@pedrobaeza pedrobaeza 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.

Hay un cambio de un string sin la correspondiente traducción, pero la hacemos ya en Weblate, y luego todo el tema de la causa de exención es algo que viene vinculado al impuesto, y podemos entonces desgajarlo de producto y posición fiscal, pero eso lo hago en un PR posterior. Vamos a fusionar.

Gracias por el trabajo, y toda la conversión de dominios, que ha tenido que dar guerra.

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-4956-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit e2cff7e into OCA:19.0 Jun 13, 2026
5 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@Shide
Shide deleted the 19.0-mig-l10n_es_aeat_sii_oca branch June 15, 2026 07:26
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.