Sayyiduna Jabir (may Allah be pleased with him) narrates: We did not use to eat onions and leeks, but then we felt the need for them, so we ate them. The Prophet (peace and blessings of Allah be upon him) said: Whoever eats from this odorous tree (its fruit), let him not come near our mosque, for the angels are harmed by what harms the children of Adam.
Hadith Referenceصحیح ابن حبان / كتاب الصلاة / 2086
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «الإرواء» (2/ 334): م.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط مسلم، رجاله ثقات رجال الشيخين غير أبي الزبير، فمن رجال مسلم، وقد صرح بالتحديث عند الحميدي (1278).