The Cadbury factory is more than 100 years old and as it turns to further automation it has announced job losses next year.