diff --git a/addons/stock/wizard/stock_picking_return.py b/addons/stock/wizard/stock_picking_return.py index 9e68c88781f..936c2022f19 100644 --- a/addons/stock/wizard/stock_picking_return.py +++ b/addons/stock/wizard/stock_picking_return.py @@ -80,7 +80,8 @@ class ReturnPicking(models.TransientModel): for move in return_moves: to_check_moves = self.env['stock.move'] | move.move_dest_id while to_check_moves: - current_move = to_check_moves.pop() + current_move = to_check_moves[-1] + to_check_moves = to_check_moves[:-1] if current_move.state not in ('done', 'cancel') and current_move.reserved_quant_ids: unreserve_moves |= current_move split_move_ids = self.env['stock.move'].search([('split_from', '=', current_move.id)])