Preheat the oven to Mark 5 / 375oF / 190oC. Sieve the flour and salt into a small bowl. Cut margarine into small pieces and rub it into flour until it resembles fine breadcrumbs. Add enough cold water to mix to a firm dough. Roll out on floured board and line the tin.

Melt butter in pan, add onions and bacon and cook for 15-20 minutes, stirring frequently. Remove from heat, stir in flour and mix well. Beat milk with eggs and pour over onions, mixing well. Season and pour into flan case. Bake for 25-30 minutes. Serve.