Pass the beans through a food mill, or puree in a blender or food processor. Place the pureed beans in a medium mixing bowl; set aside.
Heat 2 tablespoons of oil in a medium skillet over medium heat. Add the onion; sauté, stirring frequently, until translucent, 7 to 10 minutes. Transfer the cooked onion to the bowl with the beans. Stir to combine and season to taste with salt and pepper. Add 2 tablespoons of flour; using a wooden spoon, stir to combine the ingredients.
Place the remaining ½ cup of flour in a shallow bowl. Using your hands, form small balls of the bean-and-onion mixture about the size of a golf ball. Flatten into ¼-inch-thick rounds, 2 to 3 inches in diameter. Lightly coat with flour.
Heat enough oil to barely coat the bottom of a medium skillet. When the oil is hot but not smoking, add 3 or 4 fritters to the pan, ensuring they don't touch. Cook until crisp and golden brown, 5 to 7 minutes each side. Drain briefly on paper towels. Repeat with the remaining fritters; serve hot.