Sayyiduna Ali (may Allah be pleased with him) said: Sayyiduna Umar bin al-Khattab (may Allah be pleased with him) debated with me about the sale of ummahat al-awlad. I said: "They may be sold," and he said: "They may not be sold." Sayyiduna Umar (may Allah be pleased with him) kept coming back to me on it until I accepted his view, and he ruled that way throughout his life. When I became caliph, my view was that they should be sold. Muhammad bin Sirin (may Allah have mercy on him) narrates from Ubaydah (may Allah have mercy on him) that he said: I said to Sayyiduna Ali (may Allah be pleased with him): "Your collective view is dearer to me than your opinion alone."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21767