Cut each onion in half, then cut the halves into thin strips.
Toss the the oil and butter into a skillet, and heat them over medium heat. Then, toss in the onion, stir, then cover the pot and let it simmer for 10 minutes.
After 10 minutes are up, uncover the dish, add a little salt and sugar and let it caramelize for 40 minutes. Reduce the heat to medium-to-low. Stir occasionally. Don’t add water, rather reduce the heat.
In the meantime, prepare the stock and preheat the oven to 350 °F (180 °C).
Layer your baking tray with baking paper, and put the slices of bread on the tray. Sprinkle half of the prepared grated cheese over them.
When the onions are caramelized, add stock, thyme, bay leaf, salt, and pepper. Bring it to a boil, leave it on for another 10 minutes, then turn off the heat.
Do this step simultaneously with the previous one: put the bread in the preheated oven for about 13 minutes at 350 °F (180 °C).
The soup is ready just about when the bread and cheese is.
Now take out the bay leaves.
Divide the finished soup into plates while it is still hot. Sprinkle with cheese and place a slice of bread with melted cheese on top of each plate.