This question has been flagged
1 Reply
7511 Views


How can I set a default user as the current user in new API,

in the V7 :

     'user_id': lambda obj, cr, uid, context: uid,

Avatar
Discard
Best Answer

Hello,

You can try this one

user_id = fields.Many2one('res.users', string='My User',default=lambda self: self.env.user) 
Avatar
Discard