[16.0][FIX] l10n_es_aeat_mod_369: No recalcular line_number debido a incons… #3975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…istencias en ciertos casos donde genera que se repita el mismo número y reemplaza registros del dict oss_taxes_map
Existe un caso muy específico en el método
_get_oss_taxes_map
. Al iterar enfor country, taxes in oss_countries.items()
y tenemos queprevious_tax_count == 5
la fórmula indicadaline_number += 8 - (previous_tax_count * 2)
siempre se traducirá aline_number += -2
. Por ende, en este casoline_number
siempre será equivalente alline_number
del último impuesto añadido aoss_taxes_map
y debido a esto, ese último impuesto será reemplazado por el actual y provoca que no se vea reflejado en el reporte 369.Para replicar en runbot:
Se entiende que al realizar esta búsqueda al comienzo del método:
oss_taxes = self.env["account.tax"].search([("oss_country_id", "!=", False), ("company_id", "=", self.company_id.id)])
El primer registro siempre será el último creado, entonces:
Crear clientes:
Crear facturas:
Generar 369:
Error-mod-369.mp4
correccion-mod-369.mp4
No termino de darle el sentido a la fórmula
line_number += 8 - (previous_tax_count * 2)
. Al dejar que siga con su secuencia de +2 en cada iteración, el reporte se genera igual de correcto.