Preheat oven to 350°F (175°C) and lightly grease a 9x13 inch baking dish.
Heat olive oil in a skillet. Cook diced onion with salt until soft and slightly golden.
In another skillet, cook ground beef with salt, pepper, and onion until browned. Drain excess fat.
Add cumin and chili powder to the sauce onions. Stir for 30 seconds, then mix in flour.
Slowly whisk in chicken stock, then add tomato sauce and garlic. Simmer until slightly thickened.
Mix green chiles and black beans into the cooked beef.
Optionally blend sauce until smooth for a silky texture.
Spread a thin layer of sauce in the baking dish.
Mix 1/2 cup sauce into the beef mixture.
Dip tortillas in sauce and layer 6 in the dish. Add half the beef mixture and 1 cup cheese.
Repeat layering with remaining tortillas, beef mixture, and finish with cheese.
Bake uncovered for 20 minutes until cheese is melted and bubbly. Let rest before serving.