[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user