Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] stock: consider multi-steps in forecast availability
Steps to reproduce: - Enable multi-step routes in the settings - Inventory > Configuration > Warehouse Management > Warehouses - Change your warehouse to manufacturing in 3 steps - Create a storable product COMP with 10 units in stock - Create a manufacturing order for a product Final product using COMP as components > The forcast of the components indicates that they are not available Cause of the issue: The location query of the `_get_forecast_availability_outgoing` was recently changed to: https://github.com/odoo/odoo/blob/49061347c181b1a451435bc363bb9508db8b6fab/addons/stock/models/stock_move.py#L2253 This change was made for optimisation purposes because the forecast lines now take care of the precise locations here: https://github.com/odoo/odoo/blob/49061347c181b1a451435bc363bb9508db8b6fab/addons/stock/models/stock_move.py#L2255 However, this optimisation is not correct as the forecast the result of this query is used in order to determine if a move is incoming or outgoing here: https://github.com/odoo/odoo/blob/49061347c181b1a451435bc363bb9508db8b6fab/addons/stock/report/stock_forecasted.py#L31-L44 and these domains only makes sense if the wh_location_ids are indeed all the locations of the warehouse and not these that are children of the "pre-prod" location. opw-3979953 closes odoo#179989 X-original-commit: be55bf0 Signed-off-by: William Henrotin (whe) <[email protected]> Signed-off-by: Lancelot Semal (lase) <[email protected]>
- Loading branch information