Skip to content

Conversation

@IvanHRN
Copy link

@IvanHRN IvanHRN commented Oct 28, 2025

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.

@pedrobaeza pedrobaeza added this to the 14.0 milestone Oct 30, 2025
if not matching_entries:
continue

verifactu_invoice_entry = matching_entries[0] # Assume one match
Copy link
Member

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?

Copy link
Author

@IvanHRN IvanHRN Oct 30, 2025

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.

Copy link
Author

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.

@IvanHRN IvanHRN force-pushed the 14.0-fix-l10n_es_verifactu_oca-response_lines_matching branch from f879e9a to 47f4f0b Compare October 31, 2025 08:42
if not verifactu_invoice_entry:
matching_entries = self.sorted(
lambda x: x.create_date, reverse=True
).filtered(lambda r: r.document_name == invoice_num)
Copy link
Member

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?

Copy link
Author

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.
@IvanHRN IvanHRN force-pushed the 14.0-fix-l10n_es_verifactu_oca-response_lines_matching branch from a081322 to 87c0c80 Compare October 31, 2025 09:21
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 14.0-ocabot-merge-pr-4520-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 9bf5644 into OCA:14.0 Oct 31, 2025
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 58bc692. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants