Preheat the oven to 350 degrees F (175 degrees C). Butter a casserole dish.
Place one layer of potato and onion slices in the prepared dish. Add salmon. Sprinkle flour over top until salmon layer is covered. Sprinkle with ½ of the salt and pepper.
Layer with remaining onion and potato slices, then sprinkle with remaining salt and pepper. Add milk and top with butter.
Bake, covered, in the preheated oven until golden brown, about 1 hour and 15 minutes.
