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

[14.0][FIX] delivery_carrier_preference: fix perf issue when editing packaging from product form #961

Merged

Conversation

sebalix
Copy link
Contributor

@sebalix sebalix commented Dec 16, 2024

On products having a lot of moves, editing packaging from product form is triggering heavy computation as a side-effect, even if the estimated_shipping_weight field is not stored.
Odoo is fetching moves and then pickings of these moves through this line:

https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/odoo/models.py#L5904

This can be reproduced on a demo DB with only delivery_carrier_preference installed (putting a pdb in the Odoo line above shows that picking_id is accessed and with enough moves in DB, a latency can be experienced).

On products having a lot of moves, editing packaging from product form
is triggering heavy computation as a side-effect, even if the
'estimated_shipping_weight' field is not stored.
Odoo is fetching moves and then pickings of these moves through this line:

https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/odoo/models.py#L5904
@sebalix sebalix marked this pull request as ready for review December 16, 2024 15:13
@sebalix sebalix requested a review from mmequignon December 16, 2024 15:21
@simahawk
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 14.0-ocabot-merge-pr-961-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit c11d156 into OCA:14.0 Dec 18, 2024
5 checks passed
@sebalix sebalix deleted the 14-fix-perf-delivery_carrier_preference branch January 3, 2025 12:32
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.

4 participants