Onions and beans don't like each others company, but there's always exceptions no hard or fast rules that I can think off, but I always keep these 2 away from each other
I grew onions next to me beans this year, having only got the plot in May I quickly cleared a bed and chucked whatever I could in, which meant I paid little attention to what should go where. Both crops did really well, but next year I will be following more of a crop rotation plan, just to try and avoid any problems.