[FIX] mrp: set right availability when subcontracting
Steps to reproduce: - Enable subcontracting & multi-step routes - Inventory -> Routes -> Unarchive MTO - Create a subcontracted bom for a product S by vendor V - Set V as supplier for product S and set route Buy & MTO - Create a MO that uses S as a component and confirm it - Go to the related RFQ and confirm it - Go back to the MO and open the Overview Issue: The component S has its receipt marked as "Available", even though the product isn't received yet. When checking the previous moves in the chain, the move from production -> subcontracting (end move of the subcontracted MO) will be read and check its `reserved_availability`, which isn't right. Task-3251506 Part-of: odoo/odoo#114536
This commit is contained in:
@@ -730,7 +730,7 @@ class ReportMoOverview(models.AbstractModel):
|
||||
if not replenish_data['qty_reserved'].get(move_raw):
|
||||
total_reserved = 0
|
||||
wh_location_ids = self._get_warehouse_locations(warehouse, replenish_data)
|
||||
linked_moves = self.env['stock.move'].browse(move_raw._rollup_move_origs()).filtered(lambda m: m.location_id.id in wh_location_ids or m.location_dest_id.id not in wh_location_ids)
|
||||
linked_moves = self.env['stock.move'].browse(move_raw._rollup_move_origs()).filtered(lambda m: m.location_id.id in wh_location_ids)
|
||||
for move in linked_moves:
|
||||
if move.state not in ('partially_available', 'assigned'):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user