In a large frying pan, heat the oil over a medium heat. Add the onion and cook until soft. Add the garlic, thyme, and bay leaves and cook for 1 more minute. Stir in the tomatoes and water or stock. Bring to a boil and cook gently, uncovered, for 15-20 minutes, until most of the liquid has evaporated and the liquid has thickened.