Heat a knob of the butter and the olive oil in a large frying pan. Once melted, add the onions and herbs and fry gently until the onions are soft and nicely browned. Discard the rosemary and thyme sprigs. Preheat the oven to 180C/160C Fan/Gas 4.
Melt the remaining butter in a small saucepan.
Using roughly a quarter of the sliced potatoes, arrange a layer of potato in the bottom of a 1.5 litre/2½ pints shallow ovenproof dish, overlapping the slices. Brush with melted butter and season with salt and pepper.
Add a third of the onion mixture and spread to the edges of the dish. Repeat the layers of buttered potato, onions and seasoning, ending with a layer of potatoes.
Slide the bay leaves under the top layer of potatoes and slowly pour over the stock, allowing time for it to trickle to the bottom of the dish.
Bake for 1–1¼ hours, or until the potatoes are very tender and browned on top. You can test they are done with tip of a knife.