- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 567
 
[14.0][FIX] l10n_es_verifactu_oca: Mejora en el matching de las respuestas de verifactu #4520
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
[14.0][FIX] l10n_es_verifactu_oca: Mejora en el matching de las respuestas de verifactu #4520
Conversation
| if not matching_entries: | ||
| continue | ||
| 
               | 
          ||
| verifactu_invoice_entry = matching_entries[0] # Assume one match | 
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.
¿El orden de estos documentos es de más reciente a más antiguo para que coger el primero sea equivalente a document.last_verifactu_invoice_entry_id?
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.
El order del modelo verifactu.invoice.entry es id desc por lo que entiendo que es correcto. No obstante, tendría que probarlo para salir de dudas.
Comentar que el código pensaba que lo había cogido de la v16 pero no es así, lo he traido del PR #4378 realizado por @ljsalvatierra-factorlibre para el l10n_es_verifactu_pos_oca.
Lo que se busca es eliminar la limitación de búsqueda del document por el campo name, ya que en pos.order sería l10n_es_unique_id.
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.
Tenías razón @pedrobaeza. No estaban ordenándose bien, así que he aplicado una ordenación previa por fecha de creación.
f879e9a    to
    47f4f0b      
    Compare
  
    | if not verifactu_invoice_entry: | ||
| matching_entries = self.sorted( | ||
| lambda x: x.create_date, reverse=True | ||
| ).filtered(lambda r: r.document_name == invoice_num) | 
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.
Mejor primero hacer el filtered y luego el sorted por rendimiento, no?
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.
Cierto, cambiado el orden.
…estas de verifactu, de la misma manera que en la v16.
a081322    to
    87c0c80      
    Compare
  
    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.
/ocabot merge patch
| 
           On my way to merge this fine PR!  | 
    
| 
           Congratulations, your PR was merged at 58bc692. Thanks a lot for contributing to OCA. ❤️  | 
    
Se hace de la misma forma que en la versión 16, de tal manera que el matching no queda limitado al campo name.
Está relacionado con #4518.