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

[16.0][IMP] stock_available_to_promise_release: Improves perfs #894

Merged

Conversation

lmignon
Copy link
Sponsor Contributor

@lmignon lmignon commented Apr 23, 2024

The field 'ordered_available_to_promise_qty' is a computed field without depends. In the implementation of the _is_release_ready we expect that this field is up to date. Prior to this change, the 'ordered_available_to_promise_qty' was invalidated into the '_is_release_ready' method to ensure consistency. Unfortunately, since the '_is_release_ready' method is designed to work a a single record, when it was called from _compute_release_ready methods on a large recordset, this way of doing has as side effect to break the batch computation of the 'ordered_available_to_promise_qty' since the value was invalidated one at a time for each record. To restore the batch computation of the 'ordered_available_to_promise_qty', the cache invalidation is now done into the caller methods for the whole recordset

The field 'ordered_available_to_promise_qty' is a computed field without depends. In the implementation of the `_is_release_ready` we expect that this field is up to date. Prior to this change, the 'ordered_available_to_promise_qty' was invalidated into the '_is_release_ready' method to ensure consistency. Unfortunately, since the '_is_release_ready' method is designed to work a a single record, when it was called from `_compute_release_ready` methods on a large recordset, this way of doing has as side effect to break the batch computation of the 'ordered_available_to_promise_qty' since the value was invalidated one at a time for each record. To restore the batch computation of the 'ordered_available_to_promise_qty', the cache invalidation is now done into the caller methods for the whole recordset
@lmignon lmignon force-pushed the 16.0-stock_available_to_promise_release-perf branch from 46f79f7 to 28842bf Compare April 23, 2024 13:30
@jbaudoux
Copy link
Contributor

jbaudoux commented Jun 4, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-894-by-jbaudoux-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jun 4, 2024
Signed-off-by jbaudoux
@OCA-git-bot
Copy link
Contributor

It looks like something changed on 16.0 in the meantime.
Let me try again (no action is required from you).
Prepared branch 16.0-ocabot-merge-pr-894-by-jbaudoux-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ee11a6d into OCA:16.0 Jun 4, 2024
5 checks passed
@OCA-git-bot
Copy link
Contributor

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

@lmignon lmignon deleted the 16.0-stock_available_to_promise_release-perf branch June 5, 2024 13:52
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.

None yet

4 participants