Sunan Abu Dawood 3344
A similar tradition has also been transmitted by Ibn 'Abbas though a different chain of narrators. This version says:
"He (the Prophet) purchased a calf from a caravan, but he had no money with him. He then sold it with some profit and gave the profit in charity to the poor and widows of Banu 'Abd al-Muttalib. He then said: I shall not buy anything after this but only when I have money with me.
حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، عَنْ شَرِيكٍ، عَنْ سِمَاكٍ، عَنْ عِكْرِمَةَ، رَفَعَهُ - قَالَ عُثْمَانُ وَحَدَّثَنَا وَكِيعٌ، عَنْ شَرِيكٍ، عَنْ سِمَاكٍ، عَنْ عِكْرِمَةَ، - عَنِ ابْنِ عَبَّاسٍ، عَنِ النَّبِيِّ ﷺ مِثْلَهُ قَالَ اشْتَرَى مِنْ عِيرٍ تَبِيعًا وَلَيْسَ عِنْدَهُ ثَمَنُهُ فَأُرْبِحَ فِيهِ فَبَاعَهُ فَتَصَدَّقَ بِالرِّبْحِ عَلَى أَرَامِلِ بَنِي عَبْدِ الْمُطَّلِبِ وَقَالَ لاَ أَشْتَرِي بَعْدَهَا شَيْئًا إِلاَّ وَعِنْدِي ثَمَنُهُ .