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

[FW][FIX] stock: create orderpoints faster #154584

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Feb 19, 2024

This commit changes the computation of product having a negative forecasted quantity to create manual orderpoints. The issue was that each replenish location needed multiple _read_group on stock.quant and stock.move on all storable product.

This commit makes only 3 _read_groups for all products x locations and post process the group and quantity sum by location in Python.

This method gives some performance gain in time as well as in memory consumption

Task: 3653272

Here is the time comparison before/after the patch for different configuration

before after
700 loc, 300 prod 14.08s 850ms
10 loc, 3k prod 2.174s 349ms
700 loc, 30k prod TO 74s

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

Forward-Port-Of: #149966

This commit changes the computation of product having a negative forecasted
quantity to create manual orderpoints. The issue was that each replenish
location needed multiple `_read_group` on `stock.quant` and `stock.move`
on all storable product.

This commit makes only 3 `_read_group`s for all products x locations and
post process the group and quantity sum by location in Python.

This method gives some performance gain in time as well as in memory
consumption

Task: 3653272
X-original-commit: 13ea202
@robodoo
Copy link
Contributor

robodoo commented Feb 19, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Feb 19, 2024

This PR targets saas-16.2 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Feb 19, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Feb 19, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 5, 2024

@Whenrow @amoyaux child PR #154596 was modified / updated and has become a normal PR. This PR (and any of its parents) will need to be merged independently as approvals won't cross.

@Whenrow
Copy link
Contributor

Whenrow commented Mar 5, 2024

fw-bot r+

robodoo pushed a commit that referenced this pull request Mar 5, 2024
This commit changes the computation of product having a negative forecasted
quantity to create manual orderpoints. The issue was that each replenish
location needed multiple `_read_group` on `stock.quant` and `stock.move`
on all storable product.

This commit makes only 3 `_read_group`s for all products x locations and
post process the group and quantity sum by location in Python.

This method gives some performance gain in time as well as in memory
consumption

closes #154584

Task: 3653272
X-original-commit: 13ea202
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
@robodoo robodoo closed this Mar 5, 2024
@fw-bot fw-bot deleted the saas-16.2-16.0-orderpoint_perf-whe-61ur-fw branch March 19, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants