Saute onions in oil until well browned. Add garlic, shallots, ginger, cardamom, fennel, chili powder and coriander. Cook for 10 minutes, stirring frequently. Now add the beans, tomatoes, potatoes, bay leaf, thyme, oregano, sugar, wine and raisins. Season, cover the pot and cook for 1 1/2 hours. Add stock if needed. Serve.