In a medium (10-inch) oven-proof omelet pan over medium-low heat, cook the pancetta in the olive oil for 5 to 10 minutes, until browned. Remove the pancetta from the pan with a slotted spoon and set aside.
Melt 2 tablespoons of the butter in the pan (don't wipe it out). Add the potatoes and fry them for 6 to 8 minutes, until cooked through and lightly browned, turning occasionally. Melt the remaining 5 tablespoons of butter in a small dish in the microwave.
Meanwhile, whisk the eggs in a large bowl, then stir in the ricotta, Gruyere, melted butter, and milk. Combine the flour, baking powder, salt and pepper and stir into the egg mixture. Add the basil.
Put the pancetta back into the pan with the potatoes and pour in the egg mixture. Place the pan in the center of the oven and bake for 50-55 minutes, until the frittata is browned and puffed and a knife inserted in the middle comes out clean. Serve hot.