Place 4 cups of oil in a deep dutch oven or a deep fryer. Heat to 350?. Pour the flour into a shallow bowl. Season with salt and pepper and combine' Place the onion rings into a large mixing bowl. Slowly pour the buttermilk over the onion rings until they are covered. Let soak for 15-30 minutes. remove the rings one at a time and shake off the excess buttermilk. Lightly dredge the rings through the flour and shake off the excess flour. Place each ring on a plate until all rings are dredged. Slowly place the rings in the hot oil one at a time so that 5 or 6 rings are in the oil. Fry for 30 seconds to one minute until golden brown and crispy. Remove from the oil using a strainer and place on a a cooling rack or pper towel. Set aside. Blanch the beans and the onions in a large pot of boiling water. Cook for 2 minutes. Remove from the water using a strainer and place in an ice water bath. Drain and remove the skins from the onions. Place the beans nd onions in a greased 11 x 13 bking dish. Set aside. Place the oil and butter into a saute pan over medium heat. Add the garlic and shallots nd cook until carmelized. Stir in the mushrooms and thyme and cook until mushrooms are soft. Add a little salt and pepper is you wish. Slowly stir in the flour and mix completely. All of the mixture should be covered with the flour as you would in making a rue. Slowly stir in the milk, stiring constntly. Once all of the milk hs been added, increse the heat to high and bring to a boil. Stir occssionlly until thickened. Pour the thickened mixture over the beans and onions. Gently stir the mixture into the beans and onions until covered. Place the uncovered cassrole into a pre-heated, 350? oven for 30 minutes. Remove from the oven and place the onion rings on the top and plae back into the over for an additional 10 minutes. Remove from the oven and let stand for 30 minutes before serving.