Heat 2 tbs of the oil in a large frypan over medium-low heat. Add onion and garlic and cook, stirring, for 20-25 minutes until soft and pale golden. Season, then stir in thyme leaves. Spread onion over the base of a roasting pan that will fit the chicken snugly in a single layer. Sprinkle over the thyme sprigs, then set aside.

Preheat the oven to 190 degrees Celcius. Heat remaining oil in the same frypan over medium-high heat. Dust chicken in flour, shaking off excess, then cook in 2 batches for 3-4 minutes each side until golden-brown. Arrange chicken over onion, then overlap 2 lemon slices on each. Squeeze over the juice from any remaining lemon slices.

Meanwhile, bring stock to the boil in a saucepan, stir in the preserved lemon rind if using, then pour around the chicken. Cook in the oven, uncovered, for 45-50 minutes – adding olives after 30 minutes and basting with stock 2-3 times – until chicken is golden and cooked. Stand in the pan for 5 minutes, then transfer chicken, onion, olives and juices to a deep platter to serve.