Soak the beans in water overnight. Drain the beans, then rinse under cold running water. Put them in a large saucepan, cover with cold water and bring to the boil. Boil rapidly for 10 minutes, then reduce to a simmer for 50 minutes, or until tender. Drain well, reserving 1½ cups of the bean cooking liquid. Transfer the reserved liquid and the beans to a large casserole dish.
Preheat the oven to 150°C. Heat the oil in a frying pan over a moderate heat. Add the bacon and fry for 5 minutes until crisp. Remove and drain on paper towels, then cut into small pieces. Cook the onion in the bacon fat left in the pan for 5 minutes, or until soft. Add the bacon and onion to the casserole dish.
Combine the tomato sauce, treacle or golden syrup, chilli sauce, sugar and mustard in a small bowl, then pour into the casserole dish and stir to combine. Cover with a lid or piece of foil and bake for 1 hour, stirring once, until hot and bubbling. Serve hot.