This is a fantastic dish to serve along with your Thanksgiving meal. If you're feeling adventurous you can even make it with butternut squash instead of potato.
Preheat oven to 350°F. Butter a casserole dish or cast iron pan.
Heat half the oil in a skillet over medium heat. Add the onion, thyme, sage and cook, stirring frequently, until the onions are lightly caramelized, about 15 minutes.
Season with half a teaspoon of salt and pepper to taste. Spread in the gratin dish. Return the skillet to medium heat, and add the remaining oil.
Toss the potatoes in the flour, letting the excess fall away. Add it to the pan and cook until it begins to brown in places on both sides, about 7 minutes.
Add the parsley, season with salt and plenty of pepper, cook for 1 minute more. Layer the potatoes over the onions, cover with the cheese, then add the milk.
Cover and bake for 25 minutes, then uncover, add the bread crumbs, and bake until the top is browned and the liquid absorbed. Around 25 minutes.