- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 567
 
[16.0][FIX] l10n_es_aeat_mod_369: No recalcular line_number debido a incons… #3975
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
base: 16.0
Are you sure you want to change the base?
[16.0][FIX] l10n_es_aeat_mod_369: No recalcular line_number debido a incons… #3975
Conversation
…istencias en ciertos casos donde genera que se repita el mismo número y reemplaza registros del dict oss_taxes_map
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.
| 
           This PR has the   | 
    
| 
           There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.  | 
    
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.
Según los cambios, previous_tax_count y previous_country ya no sirve para nada. Y si es así, para qué había ese mecanismo? Creo que el objetivo era "pasar como a la siguiente fila de país".
| 
           There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.  | 
    
| 
           Ninguna respuesta?  | 
    
| 
          
 Sí, el mecanismo pretendía "pasar a la siguiente fila de país", pero sin ello también pasa al siguiente país. El problema es que en esa fórmula, cuando el último país tiene 5 impuestos, el primer impuesto del siguiente país termina reemplazando al último impuesto del último país añadido. En la descripción deje los pasos a seguir para replicarlo si es necesario.  | 
    
| 
           @sergiobstoj pero insisto: entonces la variable   | 
    

…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 == 5la fórmula indicadaline_number += 8 - (previous_tax_count * 2)siempre se traducirá aline_number += -2. Por ende, en este casoline_numbersiempre será equivalente alline_numberdel último impuesto añadido aoss_taxes_mapy 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.