Add Len to PYSON

issue3692
review3671002
Fix completion test for Reference field

The test must use only the id and should also allow negative id.

issue3700
review3691003
button press use the wrong record to popup the menu

issue3702
review3691004