From 1eed4b8097adb65a9b01af357869bb64a29516b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Fri, 3 Sep 2021 12:03:31 +0000 Subject: [PATCH] [FIX] stock,mrp: fix open forecast_report for MO components In multi-warehouse, when we open the forecasted report from a component line of MO, the default warehouse in the forecast_report was always the first of the company. Because it took destination location warehouse (== False because it is destination location == subcontracting location) instead of the source location in case of MO. task-2579011 Part-of: odoo/odoo#77092 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 8881619d854..f32c5161069 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -702,7 +702,7 @@ class StockMove(models.Model): 'active_model': 'product.product', 'move_to_match_ids': self.ids, } - if self.picking_type_id.code == 'outgoing': + if self.picking_type_id.code in self._consuming_picking_types(): warehouse = self.location_id.warehouse_id else: warehouse = self.location_dest_id.warehouse_id