Cooking the beans: Wash the beans and cook in a large kettle with the peeled whole onion, the cachucha peppers, and the cored and seeded green pepper. Cook over moderate heat until the beans are tender, about 2 hours. Make sure the beans retain their shape; do not overcook. Drain and reserve 4 cups of the cooking liquid and 2 cups of cooked beans. Wash the rice in cold water until the water runs clear, drain, and set aside.
Cooking the rice and beans: In a heavy-bottomed 4-quart pot, heat the oil over medium heat and saute the diced bacon until golden brown. Add the onion, green pepper, cumin, oregano and bay leaf. Saute, stirring for 1 minute. Add the rice and stir until all the grains are coated with oil and bacon grease. Add the reserved 2 cups of beans and the 4 cups cooking liquid, then add vinegar, sherry, and salt. Mix well, taste, and correct seasonings. Cook uncovered until all the liquid evaporates, you will see small air bubbles forming on the surface of the rice. Fluff the rice slightly with a kitchen fork. Cover and cook over low heat for 20 minutes. Remove from the heat and let stand, uncovered, at least 2 to 3 minutes before serving.