It was narrated that Ibn 'Umar said:
The Messenger of Allah (ﷺ) heard a man taking an oath by his father and said: 'Do not make oaths by your forefathers. Whoever makes an oath by Allah, let him fulfill his oath, and if an oath is sworn for a person by Allah, let him accept it. Whoever is not content with Allah has nothing to do with Allah.'