Peel and quarter the potatoes and cook in salted water for about 20 minutes. Meanwhile, finely dice the onions and bacon and fry in the butter.
Then add the drained beans and bring to the boil with 200 ml of water. Add sugar, vinegar, salt and pepper to taste and let simmer. Mix the flour with a little water in a shaker and add to the beans so that they thicken a little.
Drain the potatoes and serve as a meal with the beans.