Thinly slice the potatoes and parboil them for 4 minutes. Drain the potatoes thoroughly, toss them in the oil so they are lightly coated all over and set aside.
Place the butter, flour, tomato puree, apple juice, brown sugar, ketchup, sherry, vinegar and soy sauce in a saucepan. Heat gently, whisking constantly until the sauce comes to a boil and thickens. Simmer gently for 3 minutes, stirring.
Rinse and drain the beans and chickpeas and add to the sauce with all the remaining ingredients. Mix well.
Spoon the bean mixture into the casserole.
Arrange the potato slices over the top of the bean mixture, overlapping them slightly and completely covering.
Cover the casserole with foil and bake for about 1 hour, until the potatoes are cooked and tender. Remove the foil for the last 20 minutes of cooking time to lightly brown the potatoes.