I have a model named Joked
and I wish to store the email of the current user as foreign key. In my model I have defined my M2O relationship as shown:
last_accessed_by = fields.Many2one('res.users', string='Complainant id', default=lambda self: self.env.uid, required = True)
However, it takes the id of the user and not the email.