-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
[FIX] l10n_es_aeat_mod190: Multiple fixes #3828
base: 16.0
Are you sure you want to change the base?
Conversation
Compute for all lines, otherwise, the tax is not correctly assigned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
También tengo dudas del rendimiento de esto. Si tantas veces hay que hacer ese filtro, debería hacerse una vez en un solo sitio. Tal vez se puede tener un calculado a nivel de account.move
para ello.
def _compute_aeat_perception_keys(self): | ||
for line in self: | ||
aeat_perception_key_id = False | ||
aeat_perception_subkey_id = False | ||
if ( | ||
line.move_id.is_invoice() | ||
and line.display_type == "product" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esta línea no hay que quitarla.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si que hay que quitarla. No se muestran las lineas de impuestos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vale, pero entonces lo que hay es que cambiar la condición. Lo que no se debe computar es para las secciones, notas, etc. Hay que mirar también qué pasa con el resto de líneas, como COGS, anticipos, payment terms, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De hecho, en general el approach yo lo quitaría. Si por ejemplo introduzco nóminas, debería ponerse en la clave B,pero esta parte del código lo bloquea todo 😭
Mi siguerencia seria dejarlo como (not line.move_id.is_invoice() or line.display_type in ["product","tax"])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sí, pues a eso me refería.
): | ||
for item in self: | ||
if item.discapacidad and item.discapacidad != "0": | ||
item.percepciones_dinerarias = 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En lugar de esto, se puede hacer al principio de todo un self.percepciones_dinerarias = 0
tax_lines = item.report_id.tax_line_ids.filtered( | ||
lambda x: x.field_number in (11, 15) and x.res_id == item.report_id.id | ||
) | ||
value = 0.0 | ||
for move_line in tax_lines.move_line_ids: | ||
for move_line in tax_lines.move_line_ids.filtered(item._check_lines): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto debería llevar lambda
, y además estar en el objeto donde self
sea el elemento.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En todos lados se usa el mismo filtro que encima es grande. Lo he pasado al final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sí, pero yo te digo de la forma en la que se debería implementar. Mira también lo del tema de rendimiento.
Sin este cambio, se mezclan todos los apuntes en todos los registros individuales. Con este cambio se ve todo. Además, había un compute que no estaba pasando correctamente los datos a los impuestos. Se ha modificado.
@victoralmau @pedrobaeza