Heat a large frying pan on a medium-high heat, add the olive oil and butter. Once melted add the shallots in a single layer. Fry for around 5 minutes until golden and caramelised on one side.
Add the mushrooms, and stir every minute or so, until they’ve released their moisture and are beginning to caramelize. This should take around 15 minutes.
Add the garlic and thyme and cook for a further couple of minutes until fragrant. Add the sherry, and continue to fry until all of the liquid has cooked off. Remove from the heat and season to taste with salt and pepper.
Preheat the oven to 180°C.
Unfurl the pastry on a lined baking sheet. Use a rolling pin to shape into an oval. Spoon the mushroom mixture into a middle, spreading it to a thick even layer leaving a 4cm border around the edge. Dot the mushroom mixture with the blue cheese.
Fold and pleat the edges of the dough border over the mushrooms – leaving the centre exposed. Lightly brush the edges of the dough with the beaten egg.
Bake for 40 - 50 minutes, or until the crust is golden brown in colour. Place on a cooling rack and allow to cool for 5 minutes before slicing and serving.