I want to retrieve the id of logged-in user in Odoo 12 but I have many errors. This my code:
user_id = http.request.env.context.get('uid')
Try the following code:
user_id = http.request.env.user.id