Skip to content

[19.0][MIG] l10n_es_aeat_mod347: Migration to 19.0 - #4717

Merged
OCA-git-bot merged 109 commits into
OCA:19.0from
Studio73:19.0-mig-l10n_es_aeat_mod347
Mar 13, 2026
Merged

[19.0][MIG] l10n_es_aeat_mod347: Migration to 19.0#4717
OCA-git-bot merged 109 commits into
OCA:19.0from
Studio73:19.0-mig-l10n_es_aeat_mod347

Conversation

@pablo-cort-s73

Copy link
Copy Markdown
Contributor

[19.0][MIG] l10n_es_aeat_mod347: Migración a 19.0

Se adapta el módulo 347 a los cambios del método _read_group en Odoo 19.0:

  • Sintaxis _read_group: Ajustados los argumentos aggregates (no repetir campos de groupby)
  • Resultados por índice: Refactorizado el acceso a datos para usar tuplas (group[0], group[1]) en lugar de diccionarios, ya que es el nuevo retorno por defecto.
  • Eliminación de __domain: Se reconstruyen los dominios manualmente para las sub-consultas al no incluirse ya esta clave en los resultados.
  • Limpieza: Eliminación de llamadas innecesarias a browse() y variables no utilizadas.

@pablo-cort-s73 pablo-cort-s73 mentioned this pull request Jan 12, 2026
40 tasks
@pablo-cort-s73
pablo-cort-s73 marked this pull request as draft January 12, 2026 09:43
@pablo-cort-s73
pablo-cort-s73 force-pushed the 19.0-mig-l10n_es_aeat_mod347 branch 2 times, most recently from c1c9c96 to 4712799 Compare January 12, 2026 10:09
@pablo-cort-s73
pablo-cort-s73 marked this pull request as ready for review January 12, 2026 10:13
@acysos

acysos commented Jan 17, 2026

Copy link
Copy Markdown
Member

/ocabot migration l10n_es_aeat_mod347

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jan 17, 2026

@Reyes4711-S73 Reyes4711-S73 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.

LGTM

@pablo-cort-s73
pablo-cort-s73 force-pushed the 19.0-mig-l10n_es_aeat_mod347 branch 6 times, most recently from 6a84728 to a1bdf03 Compare January 20, 2026 14:35
@pablo-cort-s73
pablo-cort-s73 force-pushed the 19.0-mig-l10n_es_aeat_mod347 branch 3 times, most recently from 1f75e69 to 9c15404 Compare March 2, 2026 09:26

@loida-vm loida-vm 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:

  • Facturas creadas:
    Clientes:
Image Proveedores: Image
  • Clasificación: El cliente Ayuntamiento de Bilbao tiene un registro de 3.993,00€. y el cliente Mulhacén Digital S.L. de 2420€ (por debajo del límite)
    El proveedor Agencia Estatal tiene un total de 3630€
    El modelo 347 ignora cualquier partner cuyo valor anual sea inferior a 3.005,06€

  • Modelo 347:

Image

Resumen del modelo:
Total del registro de las 2 empresas declaradas (3993+3630=7623€)
Image

Excluye correctamente al partner que no llega a este valor anual mínimo (Mulhacén Digital), y asigna correctamente tanto las facturas emitidas y recibidas a sus claves de operación correspondientes (A y B)

LGTM!
Gracias!

Borja L.S and others added 10 commits March 12, 2026 17:11
- Se han renombrado los módulos para usar la nomenclatura propuesta
  por OpenERP: l10n_es para el módulo base de localización (plan de
  cuentas), l10n_es_* para el resto de módulos.

- Se eliminan los módulos extra_addons/* que deberían moverse a
  los extra-addons genéricos (no son específicos de España).

- Se renombran los __terp__.py por __openerp__.py
…ciertos módulos, por los correspondientes que se modificaron para esta versión 6.0 y en ciertos __init__ adaptamos los imports a los nuevos nombres de los ficheros. Renombrado de los archivos de traducción españoles de es_ES.po a es.po y pequeñas refactorizaciones
* FIX: Renombrado de los archivos de traducción catalanas de ca_ES.po a ca.po
* IMP: Añadidos avisos NO ADAPTADO TODAVÍA A LA VERSIÓN 6.0 a varios módulos, limpieza l10n_es_partner_mercantil
…c module for aeat models, 347 module was portedto v6.0 and adds new module to print AEAT model 349.
…ueñas mejoras generales (vistas, traducciones, código) y corrección pequeño bug por un olvido en la adaptación de la v5 a la v6
… módulo del 347, que incluían los cambios hechos por la AEAT para la declaración 2010, para la versión 6.0 del módulo, además corregimos un bug encontrado por Jordi en la versión 5.0 hoy. También añado una nueva comprobación de los registros de empresas, ya que el cif de la empresa es requerido, por lo que no va a dejar confirmar el informe, mientras no se rellene este campo en todos los registros de empresa. La agrupación de pagos en efectivo se dejó igual que en la 5.0, ya que se sigue comportando como en la 5.0, sigo animando a que si alguien conoce como mejorarla adelante.
… las mejoras introducidas en el anterior commit
…recía Pexego en la licencia, quedan los compartidos.
…elo con el detalle de los trimestes obligatorio para la declaración del 2011.
…r Cif/Nif en el cálculo del 347, por si hay más de una empresa con el mismo cif..., pequeña refactorización usando rec_name en lugar de name_get
pedrobaeza and others added 22 commits March 12, 2026 17:12
The place where it's located is too prominent for something that is
barely used, and it's stealing vertical space for displaying invoice
lines.

Thus, let's move the field to the page "Other information", after
the fiscal position, which is related as fiscal information.

TT51848
This way, we preserve the message on the partner record chatter for
traceability.
- Track the state field for annotating in the chatter the state changes.
- Don't reset to pending the partner record state after recalculating
  if there's no change in the total amount.

TT54641
The new october taxes, in its no deductible form, were not added.

TT55046
…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.
The locator is on an inherited view, so we have to put the inheritance
correctly.
Previous migration script didn't work for v18, where company-dependent fields
are JSONB columns. This commit does the correct migration, and it is only done
if not already done in previous versions.

@moduon MT-10026 MT-10479
On an environment with more than 100 companies, you get this error:

```
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/service/server.py", line 1361, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "<decorator-gen-13>", line 2, in new
  File "/opt/odoo/custom/src/odoo/odoo/tools/func.py", line 97, in locked
    return func(inst, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 129, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 485, in load_modules
    processed_modules += load_marked_modules(env, graph,
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 365, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 182, in load_module_graph
    migrations.migrate_module(package, 'pre')
  File "/opt/odoo/auto/addons/openupgrade_framework/odoo_patch/odoo/modules/migration.py", line 18, in migrate_module
    MigrationManager.migrate_module._original_method(self, pkg, stage)
  File "/opt/odoo/custom/src/odoo/odoo/modules/migration.py", line 222, in migrate_module
    exec_script(self.cr, installed_version, pyfile, pkg.name, stage, stageformat[stage] % version)
  File "/opt/odoo/custom/src/odoo/odoo/modules/migration.py", line 259, in exec_script
    mod.migrate(cr, installed_version)
  File "/opt/odoo/auto/addons/l10n_es_aeat_mod347/migrations/18.0.1.1.0/pre-migration.py", line 24, in migrate
    _convert_column(
  File "/opt/odoo/custom/src/odoo/odoo/tools/sql.py", line 371, in _convert_column
    cr.execute(query, log_exceptions=False)
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 357, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.TooManyArguments: cannot pass more than 100 arguments to a function
LINE 1: ...LT, ALTER COLUMN "not_in_mod347" TYPE jsonb USING jsonb_buil...
```

And anyway, this migration scripts should never existed, as the proper
way to do it is to forward port the patch to all versions, not as it
has been done only for 16 and 18.
@pablo-cort-s73
pablo-cort-s73 force-pushed the 19.0-mig-l10n_es_aeat_mod347 branch from 9c15404 to 5589666 Compare March 12, 2026 16:12

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

/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-4717-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit c6e7a42 into OCA:19.0 Mar 13, 2026
6 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at a68493e. 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.