Skip to content
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][PERF] account_invoice_refund_link: translate post_init_hook into SQL #1875

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

Ricardoalso
Copy link
Contributor

@Ricardoalso Ricardoalso commented Jan 6, 2025

The key changes include replacing the Python logic with a SQL query to handle the matching process more efficiently.

With a large database ( > 65 million account.move.line records) I faced a memory error when executing the post_init_hook.
By translating the python code to a SQL query it took me less than 10 minutes to execute it (postgresql V16.0)

@Ricardoalso Ricardoalso force-pushed the account_invoice_refund_link_pre_init_hook branch from a9a0826 to a251218 Compare January 6, 2025 15:02
@Ricardoalso Ricardoalso marked this pull request as draft January 6, 2025 15:10
Cache invalidation is required after writing origin_line_id in refund invoice lines in SQL
@Ricardoalso Ricardoalso marked this pull request as ready for review January 6, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant