Skip to content
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

[17.0][MIG] l10n_es_aeat_sii_oca: Migration to v17 #3737

Open
wants to merge 300 commits into
base: 17.0
Choose a base branch
from

Conversation

manuelregidor
Copy link
Contributor

@manuelregidor manuelregidor commented Sep 27, 2024

Supersedes: #3504

En esta migración se han incluido algunos cambios con respecto a v16:

  • Se ha eliminado la dependencia hacia el módulo queue_job. Ahora, el envío al SII se realiza a través de triggers, una opción base de Odoo.
  • Se han incluido las funcionalidades del módulo l10n_es_dua_sii (https://github.com/OCA/l10n-spain/tree/16.0/l10n_es_dua_sii), que en v17 ya no será necesario por haber pasado la gestión del DUA al módulo l10n-es.
  • Se ha eliminado el envío instantáneo cuando se valida una factura.

Quedará pendiente crear un nuevo campo sii_start_date en res.company, que serviría para que la función _compute_sii_enabled de sii.mixin lo tenga en cuenta para dar valor al campo sii_enabled.

T-5833

@manuelregidor
Copy link
Contributor Author

Copy link
Contributor

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

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

Un par de comentarios, antes de revisarlo funcionalmente:

  • En el README (apartado DESCRIPTION) se sigue haciendo referencia al queue_job. Ese punto habría que quitarlo.
  • Puedes poner a Sygel como autores? Hemos hecho un buen refactoring y creo que es justo estar ahí. @pedrobaeza entiendo que no hay problema en ello, no?

Gracias!

@pedrobaeza
Copy link
Member

Estoy de acuerdo con la co-autoría en este caso. Bien es cierto que AuresTIC (cc @zamberjo) por trabajos pasados también la merece.

@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch from 1fb8cbf to 7c0456a Compare September 27, 2024 07:49
@manuelregidor
Copy link
Contributor Author

@HaraldPanten Cambios aplicados. En cuanto a los autores, he añadido a Sygel. Si finalmente tengo que añadir a AuresTIC, lo hago en un momento.

@pedrobaeza
Copy link
Member

Incluid por favor #3736

@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch from 7c0456a to fc0ea1f Compare September 27, 2024 07:58
@manuelregidor
Copy link
Contributor Author

@pedrobaeza incluido

@pedrobaeza
Copy link
Member

/ocabot migration l10n_es_aeat_sii_oca

Habría que incluir (adaptando) #3740 para los nuevos impuestos de octubre.

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Sep 28, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Sep 28, 2024
49 tasks
@pedrobaeza
Copy link
Member

Para incluir también #3741, y se pueden juntar ambos commits, ya que es un leftover del primero.

@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch 2 times, most recently from ef7a702 to 7455920 Compare September 30, 2024 06:27
@manuelregidor
Copy link
Contributor Author

@pedrobaeza commits añadidos

@pedrobaeza
Copy link
Member

Incluye por favor #3759, y a ver si esta semana lo puedo revisar ya para fusionarlo.

@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch from 7455920 to 6511e98 Compare October 9, 2024 13:24
@manuelregidor
Copy link
Contributor Author

@pedrobaeza commit #3759 añadido

@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch from 6511e98 to 69e97db Compare October 21, 2024 05:49
Copy link
Contributor

@Jesarregui Jesarregui left a comment

Choose a reason for hiding this comment

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

Functional Review: LGTM

Copy link
Contributor

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

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

Seems to be OK.

Copy link
Contributor

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

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

Disculpad, para el SII vamos a añadir la compatibilidad con DUA (impuestos que ya llevan en el core) en este mismo módulo, no me acordaba.

Queda este aspecto pendiente.

@HaraldPanten HaraldPanten self-requested a review October 30, 2024 14:34
@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch 3 times, most recently from 82c6319 to 2467f8e Compare November 4, 2024 17:08
Copy link
Contributor

@Jesarregui Jesarregui left a comment

Choose a reason for hiding this comment

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

Functional Review: LGTM

@manuelregidor
Copy link
Contributor Author

@pedrobaeza @etobella @acysos Ya se puede revisar.

pedrobaeza and others added 22 commits February 13, 2025 14:21
Since several days ago, the agency is returning tiemout when trying
to connect to it. It's not happening for all the hosts, but GitHub
is affected.

The only solution for now is to disable the connection tests.

We also remove the old Gipuzkoa agency.

Fixes OCA#3589
It seems they are working regularly again.
Some others modules call reversal but active_ids is not an account.move: module OE helpdesk_account (from a helpdesk ticket, we can create a "Refund")
…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
@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch from 6fd6212 to 1e33ea0 Compare February 13, 2025 13:33
Copy link
Contributor

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

Algunos comentarios. Por otro lado, sería interesante ir guardando los triggers realizados para el sii? se podría modificar la función de _gc_cron_triggers
https://github.com/odoo/odoo/blob/e957e9bbc6ac68e8a89be4f6fbc46928adb24584/odoo/addons/base/models/ir_cron.py#L554

@@ -96,6 +96,52 @@
name="sii_wsdl_ps_test_address"
>https://sii-prep.egoitza.gipuzkoa.eus/JBS/HACI/SSII-FACT/ws/fr/SiiFactPAGV1SOAP</field>
</record>
<!-- TODO: remove?-->
<record id="aeat_sii_tax_agency_gipuzkoa_1_0" model="aeat.tax.agency">
Copy link
Contributor

Choose a reason for hiding this comment

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

¿Vale la pena mantener las conexiones antiguas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Quizás se puedan eliminar ya, solo que me tendrían que confirmar cuáles son las que ya no van a ser necesarias.

@@ -37,7 +37,7 @@ def default_get(self, fields_list):
if (
"sii_refund_type" in fields_list
or "sii_refund_type_required" in fields_list
) and self.env.context.get("active_model") == "account.move":
):
invoices = self.env["account.move"].browse(
Copy link
Contributor

Choose a reason for hiding this comment

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

en vez de un browse, se podría realizar un search y ampliar el dominio para que ya devuelva directamente las facturas de tipo "in_invoice", "out_invoice", debido a que después no se vuelve a utilizar "invoices".
supplier_invoices.mapped("company_id.sii_enabled") --> No habría que revisar también el diario etc?

@manuelregidor
Copy link
Contributor Author

@ValentinVinagre Con respecto a la pregunta sobre si sería interesante ir guardando los triggers realizados para el sii, te comento. Por como funcionan los triggers, yo creo que no vale la pena. El trigger lo que hace es lanzar una planificada que puede que realice el envío de varias facturas al SII (es decir, el resultado del trigger no es el envío de una factura en concreto sino de todas aquellas que están pendientes de enviar). Con los jobs sí que cada job se encargaba del envío de una sola factura, pero con los triggers esto ha cambiado.

@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch 2 times, most recently from 8a6ad61 to 9e04655 Compare February 18, 2025 08:00
@manuelregidor manuelregidor force-pushed the 17.0-mig-l10n_es_aeat_sii_oca branch from 9e04655 to 96cda40 Compare February 20, 2025 16:11
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.