Melt the butter in a large pan, add the onions and courgettes. Cook for 5 minutes on a medium heat, stirring occasionally. Add the tomatoes and flour, cook for a couple of minutes while stirring to stop the flour from becoming lumpy. Add the turmeric and stock. Cover and simmer for 30 minutes. Puree with a stick blender. Serve hot with crusty bread.