Soak the beans previously by adding 1 teaspoon salt and 1 teaspoon of sugar (better to do it in the evening if you are planning to prepare next day), 2 onions cut into cubes, fry in olive oil until golden brown. Then, add the grated tomato and 1 tablespoon of tomato paste. Stir and fry for 2-3 minutes. After that, add the beans. Fry for 2-3 minutes, add the bacon and continue to fry for another 2-3 minutes. Add salt if the bacon is not salty. Pour the water content of the water covered it. Close the pressure cooker lid and put on a program designed for beans. And if you use ordinary bowl the cooking time depends on the beans - as soon as it is cooked, you can serve. But the most interesting fact if you leave it to rest for a day or two in the fridge, it sauce gets thicker and tastes better.