Heat the vegetable oil in a large, heavy-bottomed pan until it is just beginning to smoke.
Add the potatoes and onions and fry, stirring often, for about 15 minutes, until golden brown.
Remove the pan from the heat and leave to cool a little, then take the potatoes and onions out of the oil with a slotted spoon and drain on kitchen paper.
Beat the eggs in a large mixing bowl.
Add the potatoes and onions and season well with salt and pepper.
Heat a little olive oil in a 20cm diameter frying pan, preferably non-stick.
Add the egg mixture and cook over a medium heat until it is just beginning to set – about five minutes.
Place a large plate over the frying pan and carefully tip both plate and pan over so that the tortilla ends up on the plate, cooked side up.
Slide the tortilla back into the pan and cook for another five minutes.
Repeat the procedure twice more, cooking for another five minutes or so on each side.
The tortilla should still be a little bit runny in the middle.
