All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions.
A woman during Iddah due to the death of her husband is permitted to go out of her house for a dire need but with conditions:
1. If none was available to bring her what she needs.
2. So long as her destination is of a regular distance and for a short period of time.
3. If it was safe for her.
4. If her destination was relatively close.
In addition, it is stated: "Within her Iddah period due to the death of the husband or due to dissolution of marriage by issuing irrevocable divorce by the Sharia judge, a woman is permitted to go out during daylight to buy her basic needs so long as none was available to do so on her behalf, since Al-Imam Moslim reported that the Prophet (PBUH) permitted a divorced woman to go out and harvest her palm trees." [Tohfat Al-Mohtaj vol.8 pp. 261-262].
Al Imam Ashfiee' (May Allah be pleased with him) stated as regards the aforementioned narration: "Al- Ansar's palms are very close to their houses; similarly, a woman in Iddah period should seek for nearest spots to her residence for collecting woods or going to the closest market for shopping so long as she is safe and in a dire need to do so."
Furthermore, she is permitted to go out at night to her neighbor lady for making conversation and the like, stipulated that she is totally safe in there and don't have anyone in her house to talk to; only neighbors who are adjacent to her, provided that the visit period is according to the custom and to go back and sleep in her own house, since the Prophet (PBUH) permitted so in an incompletely transmitted Hadith as assured by Ibn Omar (May Allah be pleased with them) in this regard.". And Allah Knows Best.