Preheat oven to 375°F (190°C).
Heat olive oil in a saucepan over medium heat. Add onion and salt, cook until softened.
Stir in cumin, chili powder, and flour. Cook for 1 minute.
Add tomato sauce, chicken stock, garlic, and cilantro. Simmer for 5 minutes, then set aside.
In a bowl, mix shredded chicken with salt, pepper, green chiles, and black beans.
Spread a thin layer of enchilada sauce in a baking dish.
Layer 6 tortillas, half the chicken mixture, and half the cheese. Repeat layers.
Top with remaining enchilada sauce and cheese.
Bake for 20-25 minutes until bubbly and golden.
Let cool for 5 minutes before serving.