Abu Uthman narrates from Sayyiduna Salman (may Allah be pleased with him) that he said: I made a contract of manumission (mukatabah) with my masters on the condition that I would plant five hundred date saplings for them, and when they took (and bore fruit), I would be free. I came to the Prophet (peace and blessings be upon him) and mentioned this to him. He (peace and blessings be upon him) said: "Plant, and agree the condition with them, but when you intend to plant, inform me." I informed him (peace and blessings be upon him), and he came and began planting them, except for one which I planted with my own hand. All of them took (and bore fruit) except that one.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21624