OCA / wms

Warehouse Management System for advance logistic with Odoo
GNU Affero General Public License v3.0
155 stars 191 forks source link

[16.0][IMP] stock_available_to_promise_release: Improves perfs #894

Closed lmignon closed 4 months ago

lmignon commented 5 months ago

The field 'ordered_available_to_promise_qty' is a computed field without depends. In the implementation of the _is_release_ready we expect that this field is up to date. Prior to this change, the 'ordered_available_to_promise_qty' was invalidated into the '_is_release_ready' method to ensure consistency. Unfortunately, since the '_is_release_ready' method is designed to work a a single record, when it was called from _compute_release_ready methods on a large recordset, this way of doing has as side effect to break the batch computation of the 'ordered_available_to_promise_qty' since the value was invalidated one at a time for each record. To restore the batch computation of the 'ordered_available_to_promise_qty', the cache invalidation is now done into the caller methods for the whole recordset

jbaudoux commented 4 months ago

/ocabot merge patch

OCA-git-bot commented 4 months ago

On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-894-by-jbaudoux-bump-patch, awaiting test results.

OCA-git-bot commented 4 months ago

It looks like something changed on 16.0 in the meantime. Let me try again (no action is required from you). Prepared branch 16.0-ocabot-merge-pr-894-by-jbaudoux-bump-patch, awaiting test results.

OCA-git-bot commented 4 months ago

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