01 - Preheat oven to 400°F. Line a 9-inch tart pan with the pastry, trimming any excess. Prick the base with a fork and refrigerate while preparing the filling.
02 - Heat olive oil and butter in a large skillet over medium heat. Add sliced onions and cook, stirring frequently, until softened and golden, about 15 minutes.
03 - Add sliced mushrooms to the skillet and cook until softened and moisture evaporates, approximately 8 to 10 minutes.
04 - Stir in minced garlic and thyme, cooking for 1 additional minute. Season with salt and pepper. Remove from heat and allow to cool slightly.
05 - In a bowl, whisk together crème fraîche, eggs, and milk. Mix in half of the grated cheese, seasoning lightly with salt and pepper.
06 - Evenly spread the mushroom and onion mixture over the chilled pastry base. Pour the custard filling over the vegetables and sprinkle remaining cheese on top.
07 - Bake in the preheated oven for 30 to 35 minutes, until the filling is set and the surface is golden brown.
08 - Allow the tart to cool for 10 minutes. Garnish with chopped parsley if desired, slice, and serve warm or at room temperature.