Repository navigation
[19.0][IMP] website_sale_stock_provisioning_date: reuse computed free quantity- #1364 - #1365
Merged
OCA-git-bot merged 2 commits intoOct 20, 2026
Conversation
carlos-lopez-tecnativa
requested changes
Oct 16, 2026
carlos-lopez-tecnativa
left a comment
Contributor
There was a problem hiding this comment.
Please check the CI. I think it could be related to this change in v19: now, if the context doesn't have the key, it only returns the super value and doesn't set free_qty.
https://github.com/odoo/odoo/blob/621f27d320588c575bc71bbccc72d82c7719ac46/addons/website_sale_stock/models/product_template.py#L44
I got the error when I tried to go to the shop:

The combination info already contains the available quantity computed by `website_sale_stock`, but the provisioning date computation calculates it again. For products with many variants displayed in a matrix, this redundant stock computation is repeated for every combination, increasing the number of queries and the page loading time. Explicitly disable the `website_sale_stock_available` context when retrieving combination info to preserve the standard free quantity, and reuse the computed `free_qty` instead. TT64745
pilarvargas-tecnativa
force-pushed
the
19.0-imp-website_sale_stock_provisioning_date
branch
from
October 19, 2026 11:40
898a077 to
1b745f3
Compare
Enable website_sale_stock_available by default only when the context key is not already defined. This allows other modules to explicitly disable the context flag when they need the standard free quantity, without changing the default behavior. TT64745
pilarvargas-tecnativa
force-pushed
the
19.0-imp-website_sale_stock_provisioning_date
branch
from
October 19, 2026 11:52
1b745f3 to
de69ccb
Compare
carlos-lopez-tecnativa
approved these changes
Oct 20, 2026
Contributor
|
On my way to merge this fine PR! |
Contributor
|
Congratulations, your PR was merged at 69a2898. Thanks a lot for contributing to OCA. ❤️ |
carlos-lopez-tecnativa
deleted the
19.0-imp-website_sale_stock_provisioning_date
branch
October 20, 2026 16:18
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.
fwp #1345
The combination info already contains the available quantity computed by website_sale_stock, but website_sale_stock_provisioning_date calculates it again.
For products with many variants displayed in a matrix, this redundant computation is repeated for every combination, increasing the number of queries and the page loading time.
This PR introduces two changes:
website_sale_stock_provisioning_date: Reuses the already computed free_qty instead of calculating it again, explicitly disabling the website_sale_stock_available context when retrieving combination info.
website_sale_stock_available: Respects an explicitly defined context value instead of always forcing it to True, while preserving its default behavior.
Both changes are needed to reuse the standard free quantity without altering the provisioning date calculation when website_sale_stock_available is installed.
@Tecnativa TT64745
@pedrobaeza @carlos-lopez-tecnativa please review