Preheat the oven to 160°C.
Heat 2 tablespoons of oil in a flameproof casserole and fry onions and garlic until golden.
Remove onions, then fry mushrooms in 2 tablespoons of oil and set aside.
Coat beef cubes in seasoned flour.
Fry the beef in the remaining oil in two batches until browned and set aside.
Deglaze the pan with wine, simmer until syrupy, then add stock, sauces, and herbs.
Return onions, mushrooms, and beef to the pan, cover, and braise for 1 hour.
Add potatoes and continue braising for 1 more hour.
Rub butter into salted flour, then mix with 3-4 tablespoons of water to form a stiff dough.
Wrap dough in film and refrigerate for at least 1 hour.
Warm the vinegar in a pan and stir in the Spanish onion rings.
Rest the casserole for 30 minutes and increase the oven temperature to 200°C.
Roll the pastry 2.5cm larger than the dish and discard the herbs from the stew.
Seal the pastry lid over the moistened dish rim and pierce a hole in the center.
Bake for 20-30 minutes until golden-brown.
Rest for 10 minutes and serve with the vinegar onions.