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

[MIG] l10n_es_aeat_sii_oca: Migration to v18 #4046

Draft
wants to merge 302 commits into
base: 18.0
Choose a base branch
from

Conversation

AaronHForgeFlow
Copy link
Contributor

fuentes73 and others added 30 commits February 25, 2025 11:34
* Tener en cuenta el caso regimen nacional y partner no Español
* Si el país no esta establecido, tener el cuenta los dígitos del VAT
* Si no tiene ni pais ni vat devolver vacio
[FIX] l10n_es_aeat_sii: en caso de que no haya descripción no deja guardar
* Cambiado hardcodeado de nombres de posición fiscal a configurable por posición fiscal
* Traducciones
* Se redondea la base imponible en el caso de las exentas de clientes
* Nunca se cambian a signo negativo los importes si la factira no es rectificativa
* [Información del NIF en exportaciones a Canarias
* 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.
Writing on one cursor some invoice values and on error in another,
makes the process to hang due to a lock. Deferring the write to the
end and accumulating values prevents this lock.

Closes OCA#594
* Se corrige la compañía con la que se crean los trabajos del conector
* Se corrige la creación del trabajo de cancelación sii
…ories

Refactorización de la obtención del código de país y gestión correcta de
los territorios de ultramar franceses.
Envío correcto para el caso de facturas de bienes o ISP emitidas a
clientes extranjeros con sucursal permanente en España.
As grouped taxes are unfolded on invoice tax footer, we need to
map on SII children taxes (only one of them though), not parent ones
Se añade la posibilidad de indicar las dos caves de registro adicionales.
…stro contable para el SII (OCA#621)

Según la conversación mantenida aquí https://groups.google.com/forum/#!searchin/openerp-spain/sii%7Csort:relevance/openerp-spain/ZM2GlTBI5qw/iOF-FF4YBQAJ , la fecha de registro contable para el SII de las facturas recibidas debe ser la fecha en que se registra la factura en el sistema informático, con independencia de la fecha que se establezca al asiento contable de la misma. Hasta ahora por defecto se establece esta fecha como la fecha del momento del envío (esto es correcto) pero se vuelve a obtener la fecha del momento del envío también para las modificaciones y cancelaciones posteriores, y esto es incorrecto ya que es necesario almacenar la fecha en que se comunica la factura por primera vez para no altararla si hay modificaciones o anulaciones posteriores. Se crea en este PR un campo para almacenar la fecha en que se registra la factura correctamente en el SII por primera vez y se utiliza este dato en los siguientes envíos de la factura al SII. Con esto se independiza completamente la fecha de registro en el SII de la fecha del asiento contable y se asegura además que nunca se comunicará fuera de plazo (8 días ahora, 4 días después) independientemente de la fecha contable que le demos al asiento. Los contables sólo deberán tener en cuenta que deben enviar las facturas que quieran deducirse en un mes antes del día 16 del mes siguiente.
He añadido además una migración para establecer el valor del nuevo campo de fecha de registro en el SII a partir del dato 'FechaRegContable' ya comunicado y que se almacena en el último envío al SII de cada factura.
…s enabled

In partners, the check is only visible if the company has SII enabled. Before this,
the check was done looking to the partner company, but you can leave this field
empty (specially in a multi-company environment), and then the result is not correct.

Looking to the user company gives us the proper result.
[FIX] l10n_es_aeat_sii: Don't replace taxes in SFRSA, but add them
* Corrige errores y pylint
* post_init_hook
* Corregida referencia a conector
* Permisos y cmapo de posicion fiscal erróneo
aritzolea and others added 28 commits February 25, 2025 11:34
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
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.