Fix error in many to one template

Sometimes we got something like this Proxies\__CG__\Acme\AdminBundle\Entity\Sample with id == null as value, if we try to generate url for this object, we got excpetion with message "Parameter "id" for route "admin_acme_admin_sample_edit" must match "[^/]++" ("" given) to generate a corresponding URL.". I fixed this bug.