Season the chicken well with salt and pepper. Put a large pan on a medium heat and add the oil. When it’s hot, add the chicken skin side down. Cook for 6-7 minutes, until golden, then flip and cook for another minute. Turn off the heat. Do this in batches if you need to.
Meanwhile, put another pan on a medium heat and add the diced pancetta. Cook for 3-4 minutes until the fat is running out.
Peel and chop the onion and garlic. Add to the pan with the pancetta and cook for 2-3 more minutes. Add the mushrooms and cook for 5 more minutes, stirring frequently.
Tip in the flour and stir well. Add the wine, gradually at first, stirring all the time. Add the thyme and the chicken thighs, then turn down the heat to low and cook at a gentle simmer for an hour.
Preheat the oven to 180 degrees C.
Pour the chicken filling into a large oven proof dish. Roll the pastry out to 5mm thick (if it is not ready rolled) and place over the dish. Use the back of a fork to crimp down the edges, and pierce a hole in the middle.
Put in the oven for 40 minutes, until puffed up, golden and crisp.