the rented asset to someone who does not act in his stead. Ibn 'Aqil mentioned that.
Section: If the purchaser stipulates the benefit of the seller in the sold item, and the seller puts forward someone to perform the work in his place, he may do so; for he is here in the position of a hired worker (ajir mushtarak), and it is permissible for him to perform the work himself or by someone who acts in his stead. If he wishes to offer compensation for that, the purchaser is not obligated to accept it. If the purchaser wishes to take compensation for it, the seller is not obligated to provide it, because exchange is a contract of mutual consent, so neither of them can be compelled to it. If they both consent to it, it is potentially permissible, because it is a benefit for which it is permissible to take compensation even if he had not stipulated it. So if the purchaser acquires it, he may take compensation for it, just as if he had rented it, and just as it is permissible to rent out the benefits bequeathed by the testator to the heirs of the testator. It is also possible that it is not permissible, because it is something stipulated by the rule of custom and discretion due to necessity, so taking compensation for it is not permitted, like a loan, for it is permissible to return [the loan] in bread or dough as less or more. However, if he wanted to take [compensation] for the amount of his bread and its [relative] value for the amount of the permissible excess, it would not be permitted. And because it is taking compensation for a customary benefit where custom dictates overlooking it rather than taking compensation, it is similar to the benefits exempted by law, which is the case where one sells land containing crops belonging to the seller, and he is entitled to keep them until the time of harvest; if he were to take it [the land] as mown grass to benefit from the land until the time of harvest, he would not have the right to do so.
Section: If he said: "I have sold you this house and rented it to you for a month," it is not valid; because if he sold it to him, the purchaser has acquired the benefits, and if he then rented it to him, he has stipulated that there be a substitute in exchange for what the purchaser already owns, so it is not valid. Ibn 'Aqil said: The Prophet (may Allah bless him and grant him peace) forbade the 'qafiz of the miller.' Its meaning is that one hires a miller to grind for him for a wage of a qafiz from it, so it becomes as if he stipulated his work on the qafiz as a substitute for his work on the rest of the grain being milled. It is possible for it to be permissible, based on the stipulation of the seller's benefit in the sold item.
(26) Narrated by al-Bayhaqī, in: Chapter: The prohibition of the stud fee of a stallion, from the Book of Sales. al-Sunan al-Kubrā 5/339. And al-Dāraquṭnī, in: The Book of Sales. Sunan al-Dāraquṭnī 3/47.