Heat the olive oil in an ovenproof, medium-large pan and saute the onions for two minutes.
Add the garlic and cook for another minute, then add the courgettes, tomatoes, tomato puree and spices, cover with a lid and simmer for about 20 minutes. The tomatoes and courgettes will release water and turn into a sauce. In case they don't release enough juice, you can add a little bit of water or passata to adjust the consistency to your liking.
Cover the dish with the halloumi slices and place it under the grill until the halloumi slices turn golden brown.