On a custom module we have a Many2one to party.party model called agent.
We want to have an email template that sends the email to the agent when set but fallback to the customer when not set. So we set the following expression:
After debugging a little i’ve just found that the expression just returns the id of the party.party model. As this is an integer field the system is unable to get the email nor the name of the party.