Odors are often locked up in the walls and often impossible to clean with damaging the paint surface. In this case, walls and ceilings are overdue for repainting. I will use paint fragrance products in cases where the paint smell would be more offensive than the smell of a light amount of fragrance. Always smell the fragrance prior to having mixed in the paint and only add fragrance to ceiling paint to avoid overdoing it.
Whenever possible, use low or no VOC (Volitile Organic Compounds) paints especially in areas with poor ventilation like stairwells and closets.
The smell of fresh paint is better than bad odors but it’s still a smell and smells are sale killers. Plan ahead and use the best available paint. Regardless of what paint you use, there will be off-gasses and these odors need to be managed by proper ventilation.