Green’s Dictionary of Slang

bean n.2

[abbr. beanstalk or beanpole or f. bean-tosser n.; or simply joc. use of SE bean]

1. [mid-19C+] a general term of affectionate address; usu. as old bean

2. [1910s] (US) a foolish or unpleasant person.

3. [1920s] (US black) a black person.

4. [1970s] any person.

In compounds

bean-trap (n.)

[late 19C] (US Und.) a high-class confidence man.

In phrases

old bean (n.) (also old haricot)

1. [1910s+] a fellow, a term of address, usu. to a man.

2. [1940s] an old person, seen affectionately or kindly.