Heat 4 Tbsp of olive oil over medium-high heat in a 12" cast iron skillet. Add the sliced onions and sauté until light brown in colour. Add the thyme and sauté for another minute. With a slotted spoon remove the onions and thyme and mix them into the beaten eggs. Season the egg-onion mixture with sea salt and pepper. Heat the oven to 375°F. With the oil remaining in the skillet, lightly season the potato slices with a sprinkle of sea salt and pepper and layer the slices in concentric circles at the bottom of the skillet. Continue layering until all potatoes are used. Brown the bottom layer of potatoes over medium heat-high for 2 minutes being careful not to burn the potatoes. Pour in the egg-onion mixture over the potatoes and cover the skillet with a lid. Place the covered skillet in to the preheated oven for 10-15 minutes until the egg layer on top is golden brown and the potatoes are tender. Invert the tortilla on to a platter and serve warm or allow to cool to room temperature. Serve with aioli.
Add the egg yolks and sea salt to a food processor or blender. While processing, slowly drizzle in the olive oil. Stop the machine and scrape down the sides if necessary. Once all the oil has been added, pour in the lemon juice and process until combined. Check for seasoning.