[FIX] stock: slow recurring computation #32990
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The methods
_compute_is_initial_demand_editable
and_compute_is_locked
might have a significant computation time whentriggered during the modification of stock move lines. Indeed, on a
picking, the modification of a single line triggers the recomputation of
all move lines.
We attempt to optimize the process by taking advantage that:
through action buttons. It shouldn't be modified when editing a
picking.
False
Thanks to this, we only assign a value when it is
True
and avoidunnecessary assignments.
opw-1965248
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr