Grease a springform pan (26 cm diameter). Knead a dough from the first four ingredients and chill for at least 30 minutes.
In the meantime, clean the leek and cut into rings. Finely dice the onion and cut the potatoes into small cubes.
Heat the oil in a pan and fry the leek with the onion cubes. Scatter the flour on top and mix everything together. Add the potato cubes and sauté briefly. Take the pan off the stove. Mix the cream with the milk, eggs, diced ham, cheese and spices and add to the pan. Put the pan back on the stove over low heat.
Spread the batter in the springform pan. A 4 - 5 cm high border should be created. Place the filling on the dough and bake the cake in a preheated oven at 160 ° C (fan oven) for 70 minutes.