It is narrated from Sa'id bin al-Musayyib (may Allah have mercy on him) that the Messenger of Allah (ﷺ) forbade muzabanah and muhaqalah. Muzabanah is the name for buying the dates on a tree in exchange for dried dates, and muhaqalah is the name for buying wheat in its ear in exchange for cleaned wheat. Ibn Shihab (may Allah have mercy on him) said: I inquired about leasing land in exchange for dirhams and dinars, so Ibn al-Musayyib (may Allah have mercy on him) said: There is no harm in that.
Hadith Referenceمسند الإمام الشافعي / كتاب البيوع / 1413
Hadith Takhrijصحیح موصولا اخرجه ابوداود، البيوع، باب في التشديد في ذلك (3400) وابن ماجة، التجارات، باب بيع المزابنة والمحاقلة (2267)۔