Heat oil in a large heavy skillet over medium heat. Cook and stir onions until translucent; set aside. Cook ground beef until evenly brown. Drain excess fat, and set beef aside. Melt butter in the skillet. Add flour, and stir with a whisk for 5 minutes. Gradually whisk in 3 cups milk, then the cream. Simmer, stirring frequently, over medium-low heat for 10 minutes until the sauce has thickened and is smooth. Season with salt and pepper, and remove from heat.
Spread a small amount of sauce in the bottom of a 9x13 inch casserole dish. Alternate layers of potatoes, onions, ground beef, cheese and sauce, with 2 to 3 layers of each. Reserve some cheese to sprinkle on top. If you run short of sauce, press down on all layers, and add milk as needed. Sprinkle remaining cheese on top.
Bake in preheated oven for 45 to 55 minutes, or until potatoes are soft.