HOW TO GET THE CURRENT LOGIN USER ID IN THE FIELD?
27 December, 2022 by
Umme Huzaifa
| No comments yet

There are several ways to get this. One of the easiest solutions is to use compute field.

Example:

current_user_id = fields.Many2one('res.users', string='Current User', readonly=True, compute="_compute_current_user")

def _compute_current_user(self):

    self.current_user_id = self.env.uid

Umme Huzaifa
27 December, 2022
Share this post
Archive
Sign in to leave a comment