Before this commit, when the use focused a many2one field and then
pressed tab, the first item of the autocomplete dropdown was selected.
This is not what we want if the user didn't write anything in the input,
and if he didn't use the up/down keys to highlight a specific item of
the dropdown.
This commit ensures that we only select the highlighted item when the
user presses tab if he previously wrote something in the input (which
hasn't been emptied meanwhile) or if he used the up/down keys to select
a specific item.
task-2455781
closesodoo/odoo#66443
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>