Friday, July 4, 2025
1 change · saas-18.1
Enhancements to existing features
Inventory replenishment calculations are now processed in batches, improving performance when many orderpoints are evaluated. The related purchasing logic was corrected so purchase data is filtered properly and the faster calculation remains reliable when purchase_stock is installed.
Original PR description
The method `orderpoint._compute_qty_order_computed` was batched in commit 17a2de9 then reverted in commit a58b995 because of a bug introduced when purchase_stock is installed. It should still be beneficial performance-wise to batch the calls to `orderpoint._quantity_in_progress` so this commit reintroduces the batching. The part that led to the issue was the override of `_quantity_in_progress` in the purchase_stock module. In this commit we fix the `_quantity_in_progress` method. Thanks to that, the test introduced in 606dc71 is passing even with the batched version of `_compute_qty_to_order_computed`. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#213154