0
votes

How populate field email on wizard from context?

For example:

This work:

email = fields.Char(string = 'Email')

context="{'default_email': email}"

Not working:

user_id = fields.Many2one('res.partner', string = 'User', select=True)

context="{'default_user_id.email': email}"

I want pass to wizard email from selected user!

1

1 Answers

1
votes

If you want when you create a user_id from the many2one field when you click on create and edit option:

<field name="user_id" context="{'default_mail':mail}" />

When you create a user the mail will have the same value of the field mail every time.

don't pass the context to many2one record in action but in the view definition