In a large bowl, mash the beans until almost smooth.
Add sauteed onions and the rest of the ingredients, except the oil, adding the flour a few tablespoons at a time to combine well. Mixture will be thick.
Form bean mixture into patties, approximately 1/2 inch thick and fry patties in a small amount of oil until slightly firm.