Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Debt comes before the bequest, and there is no bequest for an heir."
Yahya bin Abi Unaysah narrated it in this way from Abu Ishaq from Asim, and Yahya is da'if (weak).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12563