Repository navigation
[19.0][MIG] stock_available_immediately_exclude_location: Migration to 19.0 - #93
Open
ivantodorovich wants to merge 13 commits into
Open
ivantodorovich wants to merge 13 commits into
ivantodorovich wants to merge 13 commits into
Conversation
* Replace specific code to compute the location domain from the stock quant domain by a call to a method provided by the stock_available_location_get_domain addon. This new method significantly improves the performances by avoiding the call to the 'fields_get' method on the model. This reduce the processing time to compute the domain from 17.4ms to less than 1ms. * Caching the list of locations to exclude from the immediately available quantity computation. * Avoiding to query the incoming and outgoing quantities for the locations to exclude when computing the available quantity into the locations to exclude. As result, on the workbench used when profiling the module, the time to compute the available quantity is reduced from 158ms to 134ms (15% improvement). If we take into account the performance gain of the previous commit, the time is reduced from 244ms to 134ms (45% improvement). * Restore the original behaviour on computing the available quantity for excluded locations on strict mode. IOW the available quantity is computed on records that are linked directly to the location_id and not on records that are linked to a location child of the excluded locations. This is a performance improvement and boost the computation from 134ms to 74ms (45% improvement) on the workbench test.
…ilable quantity update when excluding locations
ivantodorovich
force-pushed
the
19.0-mig-stock_available_immediately_exclude_location
branch
4 times, most recently
from
October 27, 2026 18:36
5ee1425 to
73ae4f1
Compare
ivantodorovich
marked this pull request as ready for review
October 27, 2026 19:37
ivantodorovich
force-pushed
the
19.0-mig-stock_available_immediately_exclude_location
branch
from
October 27, 2026 19:38
73ae4f1 to
1e43976
Compare
…e excluded locations Compute the immediately usable quantity on the locations of the context that are not excluded, instead of deducing the quantity on hand in the excluded locations. A delivery reserved in an excluded location was deduced twice, a date without time was taken at midnight for the excluded locations, and the lot, owner, package and expired quantities were ignored for them. A transfer out of an excluded location now only makes its goods usable once they arrive.
…excluded locations The cache keys were taken as the names of context keys that never exist, so the excluded locations only depended on the companies. Cache them for the locations, warehouses and strict key of the context.
…verride Core supports the strict context key again since 17.0.
ivantodorovich
force-pushed
the
19.0-mig-stock_available_immediately_exclude_location
branch
from
October 28, 2026 12:18
1e43976 to
85af0d1
Compare
Contributor
Author
|
Hey @glitchov , @lmignon , @bizzappdev As you worked on this module, you might be interested in its migration |
…ved locations An archived location can still hold goods, which are counted in the quantities, but it was never found among the excluded locations.
…ded locations The cached excluded locations also depend on the parent and the usage of the locations, not only on their exclusion flag. Refresh them when any of these change.
ivantodorovich
force-pushed
the
19.0-mig-stock_available_immediately_exclude_location
branch
from
October 28, 2026 13:54
85af0d1 to
448b0fc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Migration to 19.0.
Depends on:
Changes:
_get_domain_locations_newoverride for thestrictcontext key, which core supports again since 17.0, and cache the excluded locations apart with and without it.ormcache_contextwithormcache.immadiatly,immediatley).