Preheat the oven to 200ºC/Fan 180ºC/ Gas Mark 6. Heat 1 tbsp of the oil in a frying pan and fry the bacon and thyme for 1-2 minutes. Add the leeks and fry gently for 10 minutes, then set aside.
In the same pan, heat the remaining oil and fry the chicken for 10 minutes, add the leeks and season to taste. Stir in the flour and cook for 1 minute. Gradually blend in the stock and bring to the boil, then simmer for 1-2 minutes. Stir in the crème fraîche and chestnuts and transfer to an ovenproof dish approx 25cm square.
Roll out the pastry to the same dimension as the dish and place on top, tucking the edges inside the dish. Brush with beaten egg. Bake for 30-35 minutes or until golden.