Pour the red wine into a saucepan and boil for ten minutes or until reduced by nearly a quarter.
Meanwhile, heat half a tablespoon of the oil in a heavy-based frying pan and sauté the chopped shallots, celery and bacon for five minutes or until lightly browned then transfer from the pan to a dish. Return the pan to the heat then add a tablespoon of the oil.
Put the seasoned flour into a strong freezer bag, add the chicken thighs and shake well to coat all pieces of chicken. Once coated, add them to the hot pan, skin-side-down, and fry them for 3-4 minutes on each side, or until well browned.
Pour off any excess fat from the pan as best you can, then carefully pour in the brandy and flambé - standing well back while you do so. Shake the pan for several seconds until the flames subside. Transfer the chicken thighs to a casserole pot, along with any pan juices, and add the sautéed shallots, celery and bacon.
Add the chicken stock, tomato purée, garlic and sugar to the reduced red wine then pour the whole lot over the chicken in the casserole. Add the bouquet garni, cover the casserole with a lid and cook in the oven for 50 minutes to an 1 hour.
While the chicken is cooking, sauté the onions and mushrooms together in the remaining oil and butter over a moderate heat, shaking the pan occasionally to roll them around and colour them as evenly as possible. Add these to the casserole 30 minutes before the end of cooking.
Remove the casserole from the oven, add salt and freshly ground black pepper, to taste. If you want to thicken the sauce slightly then make the beurre manié by mixing the butter and flour together into a paste and whisk in tiny pieces at a time (this needs care when adding - too heavy handed and the sauce will become too thick and be ruined).
Serve straight from the casserole pot, or arrange chicken, mushrooms and onions on a warm serving dish and spoon the red wine sauce over. Garnish with the chopped parsley.