بسم الله الرحمن الرحيم
Some Ulama have explained that if a father has trained his child in religious affair in good way then whatsoever good deeds he will do the father shall also get his share in his reward, whether the child supplicates or not. However, the child should make intention while doing good deeds to send its reward to his parents. In this case, one apparently follows the saying of the Holy Prophet Muhammad (may peace and blessings of Allah be upon him) “Good child prays for his parents”. Also there is full surety that the reward shall reach to him as all agree that in this case reward reaches to the parents.
قالالملاعلىالقاري: “أوولدصالح” أيمؤمنكماقالهابنحجرالمكي،”يدعوله”: قالابنالملك: قيدالولدالصالح،لا،الأ<رلايحصلمنغيرهوانماذكردعاؤهتحريضاًللولدعلىالدعاءلأبيهحتىقيل: للوالدثوابمنعملالولدالصالحسواءدعالأبيهأملا،كماأنغرسشجرةيجعلللغارسثوابيأكلثمرتهاسواءدعالهالأكلأملاالخ(مرقاةشرحالمشكاة1/285،ط: بيروت)
Allah knows Best!
Darul Uloom Deoband