Finely grate the zest of 1 lemon, then thinly slice the lemon and set aside. Toss the potatoes and fennel in a large baking tray with the onion and lemon slices and 1 tbsp oil. Spread in a single layer and bake for 25 to 30 minutes, or until the potatoes are cooked.
Place the cod on top, sprinkle with the crushed fennel seeds and season with black pepper. Bake for another 10 to 12 minutes, or until the fish is just cooked through.
Meanwhile, make the dressing: whisk together the vinegar with the remaining oil, then add the basil, olives and lemon zest, season and mix together. Pour over the fish, scatter with any reserved fennel fronds and serve.