Boil the potatoes in salted water until tender. Meanwhile, combine the cod and cream in a saucepan and simmer 15 minutes.
Drain the potatoes and mash with the cod and cream mixture until smooth.
In a frypan, heat the oil and add the onions. Cook over high heat for 5 minutes, then reduce heat and saute 15 minutes, being careful not to burn them. Once they are softened and translucent add the sugar, stir well and add the vinegar. Cook 10 more minutes over low heat until caramelised.
Brush the bread with olive oil and sprinkle with salt and pepper. Toast under the grill until crisp.
On a platter, place neat lumps of the mashed cod and potatoes. Stick a slice of bread in each lump and serve accompanied with the caramelised onions.