Skip to content

[MIG] l10n_es_aeat_sii_oca: Migration to v18 #4046

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

Open
wants to merge 308 commits into
base: 18.0
Choose a base branch
from

Conversation

AaronHForgeFlow
Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow commented Feb 25, 2025

@AaronHForgeFlow
Copy link
Contributor Author

Comenzaré de cero después de los muchos cambios que han habido en la 17.0

@AaronHForgeFlow AaronHForgeFlow changed the title [MIG] l10n_es_aeat_sii_oca: Migration to v18 Draft: [MIG] l10n_es_aeat_sii_oca: Migration to v18 Mar 17, 2025
@pedrobaeza
Copy link
Member

Aarón, espera un poco más, que voy a hacer algunos cambios. Y luego nos reunimos para ver cómo atacar lo de los certificados. Luego te contacto por Matrix.

@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch from 5e7ab1f to 69a189b Compare April 2, 2025 11:57
@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch from 69a189b to 2efe91f Compare April 17, 2025 13:55
@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch from 2efe91f to 5ef4904 Compare June 3, 2025 08:11
@AaronHForgeFlow AaronHForgeFlow marked this pull request as ready for review June 4, 2025 11:12
@AaronHForgeFlow AaronHForgeFlow changed the title Draft: [MIG] l10n_es_aeat_sii_oca: Migration to v18 [MIG] l10n_es_aeat_sii_oca: Migration to v18 Jun 4, 2025
@AaronHForgeFlow
Copy link
Contributor Author

Probado con certificado en la web de la AEAT para pruebas, tanto con facturas de cliente como de compra e incluyendo cancelación. Ready to review.

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jun 4, 2025
@OCA OCA deleted a comment from OCA-git-bot Jun 4, 2025
@acysos
Copy link
Member

acysos commented Jun 4, 2025

/ocabot migration l10n_es_aeat_sii_oca

@OCA-git-bot OCA-git-bot mentioned this pull request Jun 4, 2025
40 tasks
@pedrobaeza
Copy link
Member

A tener en cuenta #4202

@pedrobaeza
Copy link
Member

Hay que incluir #4254

@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch 2 times, most recently from d748579 to 8751be0 Compare June 30, 2025 08:56
@HaraldPanten
Copy link
Contributor

@AaronHForgeFlow @pedrobaeza Cómo va avanzando el SII? Revisasteis lo que comentasteis de los certificados? Por saber si puedo empezar con las validaciones del PR.

Gracias.

@AaronHForgeFlow
Copy link
Contributor Author

Hola @HaraldPanten Lo miramos en los OCA Days y como no estaba nada claro que usar los nuevos ceritificados fuera mejor, ni si Odoo introducirá nuevos cambios en nuevas versiones de momento lo dejamos tal cuál. Siempre se puede hacer otra PR como mejora más adelante.

También hicimos un par de pruebas funcionales en modo test y fue bien. Así que lo podéis revisar :)

@HaraldPanten
Copy link
Contributor

Perfecto! Pues miraré de atacarlo a partir de las próximas semanas 👍

@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch from 8751be0 to 17da622 Compare July 28, 2025 14:30
pedrobaeza and others added 7 commits August 6, 2025 13:29
* Filtro de no enviados SII que sólo incluya 2017
* Los trabajos no realizados se eliminan en lugar de pasarlos a estado "Hecho"
  al reenviar, cancelar, etc.
* Permiso de lectura a queue.job para los gestores de la AEAT.
* Regla de seguridad para que los gestores de la AEAT sólo vean los trabajos
  del SII.
* Los trabajos se encolan como admin para evitar errores al validar por gente
  sin permisos del conector. Desafortunadamente, no se puede mantener el
  usuario original en el trabajo.

[IMP] l10n_es_aeat_sii: Share queue.job view for both types of invoices

[FIX] l10n_es_aeat_sii: Add jobs with sudo for avoiding permission errors

[FIX] l10n_es_aeat_sii: Permissions problem

No more need for connector or AEAT permissions

[IMP] l10n_es_aeat_sii: Track content sent + better layout for return
[IMP] l10n_es_aeat_sii: Change tax computation to invoice level

Odoo v9 already knows which tax generates each invoice tax line, so
we get with this:

* Avoid to make roundings that are not accurate.
* If there are manual changes in supplier invoices taxes, now we
  will be able to notify them and prevent not matching errors.
* Less difficult algorithms for getting tax amount totals.
pedrobaeza and others added 22 commits August 6, 2025 13:29
…er method

Since odoo/odoo@07be14e3086f473ed9a8c4b12ea7c,
Odoo has a helper method in AccountTestInvoicingCommon called
`_create_invoice`.

There are some tests here in this repository using the same name for
methods with the decorator `classmethod` and also inheriting from the
previous one, so they collide.

- l10n_es_aeat_sii_oca: l10n_es_pos_sii adds the inheritance on
  AccountTestInvoicingCommon
- l10n_es_intrastat_report: Direct inheritance.

The solution is to rename these methods to another name.
Steps to reproduce:

- Enable SII in a company with connector with a delay of 48 hours.
- Create and validate an invoice. A job is configured for being executed
  in 48 hours.
- Next day, filter "Not sent to SII", and do Action > Send to SII.

Result: the pending invoices are requeued and the delay is reapplied,
so the invoices will be sent in 48 hours from that moment. Doing this
indefinitely, the invoices will never be sent!

Although it's a weird behavior, let's avoid it not requeuing the
invoices with pending jobs.

For this, a little refactor in the code has been done, not calling
_cancel_sii_jobs, but filtering another way, and not removing previous
failed jobs, which can be considered the only functional change, and
it's not bad IMO.

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

Translation: l10n-spain-16.0/l10n-spain-16.0-l10n_es_aeat_sii_oca
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-16-0/l10n-spain-16-0-l10n_es_aeat_sii_oca/
Creación de un nuevo modelo en `l10n_es_aeat` llamado *aeat_mixin*, del
que heredan *sii.mixin* (ya existente) y un nuevo *verifactu.mixin*.
Refactor de *sii.mixin* pasando funcionalidad a *aeat_mixin*
Se han renombrado varios campos sii_* a aeat_* ya que serán utilizados
por ambos.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-spain-16.0/l10n-spain-16.0-l10n_es_aeat_sii_oca
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-16-0/l10n-spain-16-0-l10n_es_aeat_sii_oca/
Following odoo/odoo@fbc7214, this commit
puts the new taxes on the corresponding SII maps for being able to
send invoices containing them to the AEAT service.

TT51016
…atibilities (hr_expense for example)

Steps to reproduce:
- Install hr_expense
- Create a purchase type journal named Expenses and uncheck the Enable SII field.
- Go to Expense > Configuration > Settings and define in Employee Expense Journal the
Expenses journal previously created
- Create an expense and an expense sheet
- Click on the Submit to manager button
- Click on the Approve button
- Click on the Post journal entries button
- The journal entry will be created correctly without any error

TT51825
…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.
@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch 2 times, most recently from e602f73 to 8f4d5bb Compare August 6, 2025 11:37
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

¿Puedes poner el commit de la migración el último?

required="sii_enabled and move_type in ['out_refund','in_refund']"
invisible="move_type not in ['out_refund','in_refund']"
/>
name="thirdparty_number"
Copy link
Member

Choose a reason for hiding this comment

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

Todos estos cambios de indentación no parecen correctos. ¿Puedes revisar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lo miro, intencionados no son, quizás sea el pre-commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Se había colado un '/>' extra. No entiendo como no petaba 😕

sergio-teruel and others added 4 commits August 7, 2025 17:17
When using the not subjected tax for services, the reason stated in
the journal was ignored, always putting "ImporteTAIReglasLocalizacion",
on contrary than with goods, so let's call the same method to get
the reason.
@AaronHForgeFlow AaronHForgeFlow force-pushed the 18.0-mig-l10n_es_aeat_sii_oca branch from 8f4d5bb to 8750057 Compare August 7, 2025 15:26
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.