Coat a large skillet with cooking spray; add the oil, and place over medium heat until hot. Add the onion, and sauté for 5 minutes. Add the beer; cook 12 minutes or until the liquid evaporates, stirring occasionally. Remove the onion mixture from heat, and set aside.
Cook the potato slices in boiling water for 8 minutes or until crisp- tender; drain. Rinse under cold water, and drain well.
Place ⅓ of the potato slices in an 11x7-inch baking dish coated with cooking spray, and sprinkle with half of the salt and half of the pepper. Spread half of the onion mixture over the potato slices. Repeat the procedure with the remaining potato slices, salt, pepper and onion mixture, ending with the potato slices.
Place the flour in a bowl. Gradually add the milk, stirring with a wire whisk until blended. Pour the milk mixture evenly over the potato slices. Cover with aluminum foil, and cut three (1-inch) slits in the foil. Bake for 45 minutes. Uncover; sprinkle with cheese, and bake an additional 10 minutes or until the cheese melts.