Deal reached on farm animals