def set_default_verbose_name(f):
    """

    If the verbose_name of a ForeignKey was not set by user code, Lino sets it
    to the verbose_name of the model pointed to.  This rule holds also for
    virtual FK fields.

    For every FK field defined on a model (including virtual FK fields) this is
    called during kernel startup.  Django sets the `verbose_name` of every
    field to ``field.name.replace('_', ' ')``.

    For virtual FK fields defined on an actor or an action it is called a bit
    later. These fields don't have a name.

    """
    if f.name is None:
        if f.verbose_name is None:
            f.verbose_name = f.remote_field.model._meta.verbose_name
    elif f.verbose_name == f.name.replace('_', ' '):
        f.verbose_name = f.remote_field.model._meta.verbose_name
