Getting current user email with pyson

Im creating an email template from the web client interface, and I want to set the current user email in recipients_hidden by default, I’ve created a functional field which return the email but I would like to get it with pyson so I don’t need to have a field just for this.

You have the user in the evaluation context so using Eval('context', {}).get('user').get('email') should work.

I tried with something like this but im always getting invalid syntax:
And it just get deleted when saving.

In the web client, you can not use instance methods, so it must be explicit like: Get(Get(Eval('context', {}), 'user', {}), 'email').

Im working with tryton 6.0, and It looks like I don’t have the user when evaluating context, but I have the employee, anyways getting the employee from the context returns the id and I can’t apply any getter on it because its just an Integer.

Indeed the context is only in the template evaluation, we should probably include it in evaluation of the fields: Add more context to evaluation of email template PYSON (#12984) · Issues · Tryton / Tryton · GitLab