Heat the oil in a large non-stick frying pan. Season the chicken with salt and freshly ground black pepper and fry over a high heat for 10 minutes until golden-brown all over.
Meanwhile, slice the leeks into 1cm/½in rounds. Place the leeks, the onion and the thyme leaves into the slow cooker. Top with the chicken.
Add the butter to the pan, let it melt, then stir in the flour and cook for one minute or until pale gold and bubbling. Take the pan from the heat, then gradually whisk in the stock to make a smooth sauce. It will be very thick at first, but keep going. Pour the sauce over the chicken and vegetables, then cover and cook on low for 4 hours, or until the meat is very tender. Season with salt and freshly ground black pepper. Allow to cool, then chill.
Stir in the ham and the crème fraîche (if using) into the chilled chicken mixture and it's ready to top with shortcrust or puff-pastry. Bake in a hot oven for 40 minutes or until piping hot and golden brown.