diff --git a/stock_picking_return_lot/wizard/stock_picking_return.py b/stock_picking_return_lot/wizard/stock_picking_return.py index 6240270e3715..66023de6326f 100644 --- a/stock_picking_return_lot/wizard/stock_picking_return.py +++ b/stock_picking_return_lot/wizard/stock_picking_return.py @@ -27,5 +27,6 @@ def _create_returns(self): ) if ml and not ml.lot_id and (ml.product_uom_qty == line.qty_done): ml.lot_id = line.lot_id - ml_ids_to_update.remove(ml.id) + if ml.id in ml_ids_to_update: + ml_ids_to_update.remove(ml.id) return res