بسم الله الرحمن الرحيم
According to the Shari’ah, there is no will valid for an heir. However husband and wife can make a will to each other in order to save the income. And as per the will when the amount is saved after the death of any of the husband and wife then it shall be divided among the heirs as per their Shariah shares. However, it shall not be lawful for the spouses to follow the will.
Allah knows Best!
Darul Uloom Deoband
This answer was collected from the official ifta website of Darul Uloom Deoband in India.