'Abdullah (b. Umar) reported that Messenger of Allah ﷺ found, Umar b. al-Khattab amongst the riders and he was taking oath by his father Messenger of Allah ﷺ called them (saying) ; Our Allah, the Exated and Majestic, has forbidden you that you take oath by your father. He who bag to take an oath, he must take it by Allah or keep quiet.
عَنْ رَسُولِ اللَّهِ ﷺ أَنَّهُ أَدْرَكَ عُمَرَ بْنَ الْخَطَّابِ فِي رَكْبٍ وَعُمَرُ يَحْلِفُ بِأَبِيهِ فَنَادَاهُمْ رَسُولُ اللَّهِ ﷺ أَلاَ إِنَّ اللَّهَ ﷻ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ فَمَنْ كَانَ حَالِفًا فَلْيَحْلِفْ بِاللَّهِ أَوْ لِيَصْمُتْ