[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
This commit is contained in:
Rémy Voet (ryv)
2021-09-24 14:00:20 +00:00
parent d2f4cad653
commit 1eed4b8097
+1 -1
View File
@@ -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