I have made a module to alter the way entity reference works with autcomplete fields. I have override the entity_reference_autcomplete function where i have changed the following line:
$key = "$label ($entity_id)";
with
$key = "$label";
It seems to work when completing fields in form , but after the form has been submitted the autcomomplete field gets blank and the result is not saved . How can i solve this issue ?