Skip to content

[18.0][MIG] l10n_es_aeat_mod390: Migration to 18.0 #4307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 98 commits into from

Conversation

zurbaran
Copy link
Contributor

This PR migrates l10n_es_aeat_mod390 to Odoo 18.0 CE.
Changes:

Updated manifest to version 18.0.
Fixed view inheritance to match 18.0 standards ( → ).
Verified compliance with all OCA pre-commit hooks.
Executed module tests (--test-enable): all tests passed with no errors.

Ready for review. 🚀

pedrobaeza and others added 30 commits July 25, 2025 21:48
================================
Presentación del Modelo AEAT 390
================================

Modelo 390 de la AEAT. Declaración-resumen anual del Impuesto sobre el Valor
Añadido.

Instalación
===========

Este módulo requiere del módulo *account_tax_balance* que se encuentra en
https://github.com/OCA/account-financial-reporting.

Uso
===

Para crear un modelo, por ejemplo de un trimestre del año:

1. Ir a *Contabilidad > Declaraciones AEAT > Modelo 390*.
2. Pulsar en el botón "Crear"
3. Seleccionar el ejercicio fiscal.
4. Seleccionar el tipo de declaración.
5. Rellenar el teléfono y teléfono móvil, necesarios para la exportacion BOE
6. Guardar y pulsar en el botón "Calcular"
7. Rellenar (si es necesario) aquellos campos que Odoo no calcula
   automáticamente.
8. Cuando los valores sean los correctos, pulsar en el botón "Confirmar"
9. Podemos exportar en formato BOE para presentarlo telemáticamente en el
   portal de la AEAT

Problemas conocidos / Hoja de ruta
==================================

* La declaración sólo se puede realizar para personas jurídicas.
* No se han implementado todas las casillas de opciones de la empresa, como
  por ejemplo si la empresa está en concurso de acreedores o si pertenece
  al registro de devolución mensual.
* No se calculan operaciones intragrupo.
* No se contempla el régimen de criterio de caja.
* No se contempla el régimen especial de bienes usados, objetos de arte,
  antigüedades y objetos de colección.
* No se contempla el régimen especial de agencias de viaje.
* No se contempla el régimen especial de la agricultura, ganadería y pesca.
* No se contempla la prorrata general de IVA.
* No se contempla el régimen simplificado.
* No se contempla el régimen de deducción diferenciado.
* No se contempla la inversión de sujeto pasivo nacional.
* No se ha incluido el cálculo para los bienes de inversión.
* No se ha incluido el cálculo para otros supuestos de inversión de sujeto
  pasivo.
* No se tienen en cuenta tributaciones territoriales.
* Obtener las casillas 95, 97 y 98 de las declaraciones del 303.
This way, we don't initially see all the subconfigs for each model and we can concentrate
on main export configurations. This is got through `active` field default behaviour.
Archived config are still directly searchable through the subconfig selector in the
configuration line.

All models export configs have been adapted to this new approach.
Currently translated at 100.0% (137 of 137 strings)

Translation: l10n-spain-12.0/l10n-spain-12.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-l10n_es_aeat_mod390/es/
* Include chatter (mail.thread)
* Include activities (mail.activity.mixin)
* Track AEAT report state change
* Include new admin user in AEAT group by default
- Añadido Diseño de registro dr390e2019v100 para declaración de 2019
…n tests

This way, we can reuse it in other modules that don't inherit AEAT report like SII.

We also clean a non needed reading of the tax description field.

Tests were still using description method for populating data, so we switch to new
system and perform needed changes in dependent tests.

s
New tax "IVA Exento No Sujeto" must be included in field 105.
…ax fee fields

Twin of 6c3a6f2, but for model 390.

This includes the complete revision of the rest of the fields for
putting them for both signs. At the end, the refund part is controlled
by move_type, not by balance sign.

Fixes OCA#1585
This field is for reflecting RE operations that are not included with
normal VAT, so we don't have such thing in Odoo Spanish CoAs.

The explanation for this field is:

```
102. Operaciones realizadas por sujetos pasivos acogidos al Régimen
especial del recargo de equivalencia: si el sujeto pasivo es persona
física o entidad en régimen de atribución de rentas en el Impuesto sobre
la Renta de las Personas Físicas que realiza alguna actividad de
comercio al por menor a la que sea aplicable el régimen especial del
recargo de equivalencia, hará constar en esta casilla el importe, de las
entregas de bienes realizadas en el ámbito de dicho régimen especial,
excluido el propio IVA.
```

The important part is the last "excluido el propio IVA", which gives
the key about the exclusion.
Fields [95], [97] and [98] are manually entered, and they should match
the result of the report, so we check this before letting users to
confirm and having the error on AEAT website.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-14.0/l10n-spain-14.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-14-0/l10n-spain-14-0-l10n_es_aeat_mod390/
Currently translated at 100.0% (163 of 163 strings)

Translation: l10n-spain-14.0/l10n-spain-14.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-14-0/l10n-spain-14-0-l10n_es_aeat_mod390/es/
…ertain fields

There are certain fields that doesn't split refunds and regular amounts,
so we need to cover it in the same field, having refunds that decrease
the amount on the field. The only currently applicable one is the field
230, as it's the only with mapped taxes, but this commit changes
preventively other fields with currently no taxes to the same type in
case anytime are populated.

TT34123
The tax "Extracomunitario (servicios)" should go into this field instead
of in field 104, as these are the cases for the 104 field:

```
- La suma total de las contraprestaciones correspondientes a
exportaciones y operaciones asimiladas a la exportación o, en su
defecto, los valores en el interior de las operaciones reseñadas
(artículos 21 y 22 de la Ley del IVA.).
- El importe de las bases imponibles correspondientes a las devoluciones
efectuadas durante el año como consecuencia de las exportaciones
realizadas en régimen de viajeros.
- El importe de las operaciones exentas del Impuesto en virtud de lo
dispuesto en los artículos 23 y 24 de la Ley del IVA.
- El importe de las prestaciones de servicios relacionadas con la
importación y cuya contraprestación esté incluida en la base imponible
de las importaciones.
- El importe de las prestaciones de servicios exentas realizadas en
aplicación del régimen especial de las agencias de viajes (artículo 143
de la Ley del IVA).
```

which neither of them fits with this case.

On contrary, field 110 serves for this purpose:

```
Se hará constar el importe de las entregas de bienes y prestaciones de
servicios no sujetas por aplicación de las reglas de localización...
```

TT34160
OCA-git-bot and others added 28 commits July 25, 2025 21:48
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-17.0/l10n-spain-17.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_aeat_mod390/
Tax S_IVA21ISP was removed at odoo/odoo@401a961 therefore, the test data is incorrect.

If tax S_IVA21ISP is restored, this change must be reverted.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-17.0/l10n-spain-17.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_aeat_mod390/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-17.0/l10n-spain-17.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_aeat_mod390/
If the previous 303 report has remaining fee to compensate, and the
result of the report is positive and bigger than the fee to compensate,
when computing the current one, the constraint

  "The fee to compensate must be indicated as a positive number."

will raise always.

To avoid it, two changes have been done:

1. Only substract report result if it's of type C.
2. Nullify any possible result when it's less than 0.

Amendment of 4bd1c02

TT55245
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-17.0/l10n-spain-17.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_aeat_mod390/
…taxes

Odoo screwed up the tax XML-IDs in the middle of the 17.0 lifecycle,
introducing an unfolding of the exempt taxes, using existing ones
that belongs to the sales intra and extra community taxes.

After that, they have renamed the XML-IDs of both taxes to new ones.

We need to handle this in 2 ways:

- Detect and correct existing installations previous to this
  taxpocalypse for renaming them.
- Change the reference in all places to the new XML-IDs.

Besides, we have to add the unfolded exempt taxes in the reports.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-17.0/l10n-spain-17.0-l10n_es_aeat_mod390
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_aeat_mod390/
…agencia

[IMP] l10n_es_aeat*: cambio de menu a declaraciones con submenus por agencia

[IMP] l10n_es_aeat*: cambio de menu a declaraciones con submenus por agencia
@pedrobaeza
Copy link
Member

Pero @zurbaran, por qué sigues empeñado en poner un PR de este módulo, si ya hay una propuesta anterior: #4045.

Por favor, deja de proponerlo y revisa en su lugar el otro PR.

@pedrobaeza pedrobaeza closed this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.