Transfer the beans to a colander and let the liquid drain. Cut the carrots into thin strips, cut the onions into large pieces. Grind the tomatoes in a blender or pass them through a meat grinder.
Place the chopped tomatoes in a saucepan, add onions, carrots and vegetable oil. Let it simmer for 15-20 minutes.
Add beans, bay leaf, salt, sugar and pepper to taste to the pan. Stir and leave to cook for another 15-20 minutes.
Finally, add vinegar, mix thoroughly and put the salad into sterilized jars. Roll up the lid and wrap in a towel until completely cooled.