This is in accordance with the words of the Prophet SAW:
لا يَرِثُ الْمُسْلِمُ الكَافِرَ ، ولا يَرِثُ الكَافِرُ الْمُسْلِمَ
"Muslims cannot inherit infidels (and vice versa) infidels cannot inherit Muslims," (HR. Bukhari Muslim)
Through this hadith, scholars agree that non-Muslims cannot be the heirs of a Muslim.However, if on the other hand, Muslims inherit from non-Muslims, then scholars have different opinions. Some scholars say may and some other words can't.
The majority of scholars from the four major schools of jurisprudence in the world, namely the Hanafi school, the Maliki school, the al-Shafi'i school, and the Hanbali school forbade the inheritance of different religions. The word infidel in the hadith above is not between kafir harbi (who is separate from Muslims) or other than harbi, who does not add Muslims. All of them cannot be heirs.
Different from the opinion above. Imam Ibn Taymiyah and Ibn Qayyim al-Jauziyyah allowed non-Muslims to inherit a Muslim. This opinion is based on several narrations including Mu'az ibn Jabal & contemporary scholars such as Yusuf al-Qaradhawi said that the reason a person inherits is not because of religion, but because of the reason of help. Please help here is please help in the sense of please help between families.
From the permissible and not allowed above, if it is managed with Indonesia in the Compilation of Islamic Law, it is explained that different religions cannot be heirs. This is regulated in Article 171 c Compilation of Islamic Law.
However, in practice in Indonesia, non-Muslims can get inheritance from mandatory wills. What is meant by a mandatory will is to present by will. A will is a message made by someone that will be carried out after death. While the mandatory will is a will that is separated from the subject court in reality the heir just leaves a message.
In several Religious Court Decisions in Indonesia do so. As in Supreme Court Decision Number: 368/K/AG/1995 and Number: K/AG/2010.