Preheat the oven to 200°C/400°F/gas mark 6.
Heat the olive oil in a frying pan (skillet) and fry the onions and leeks until softened. Layer half the sweet potatoes, butternut squash, celeriac (celery root) and Jerusalem artichokes in a medium-sized ovenproof dish, then add half the fried onions and leeks.
Next make the creamy cheese sauce. Melt the butter in a saucepan, then add the flour and stir well, cooking for a few minutes. Slowly add the cream, whisking consistently so there are no lumps. Finally add the cheeses and continue to cook, stirring, until the cheese has melted and the sauce is smooth.
Pour half the cheese sauce over the layered vegetables, then layer the remaining prepared vegetables and add the rest of the onions and leeks on top. To finish, add the rest of the cheese sauce. Put into the oven and bake for 1 hour, then serve hot.