Set a heavy bottom saucepan over medium heat and add the oil.
When the oil is hot, add the onions. Cover the pan and cook the onion slowly until they are tender and translucent. This will take about ten minutes.
Remove the lid, raise the hit to medium high, and stir in the sugar.
Continue to cook the onion, stirring frequently, until they take on a dark walnut brown color. This will take about 20 to 25 minutes.
Sprinkle in the flour and continue ton cook the onions while stirring for an additional 2 minutes.
Remove the onion from the heat and set them aside to cool a little.
While the onions are cooling, heat the stock to a slow simmer.
Stir about 3 cups of hot stock into the onion along with the brandy.
Return this mixer to the stove over medium high heat and bring it to a simmer.
Cook this mixture gently stirring for about 3 minutes.
Add the remaining stock, loosely over high heat and bring it to a simmer the soup for about one and a half hours.
Adjust seasoning with salt and freshly ground black pepper before serving.
Serve the soup with a large mixed green salad and crusty bread.