Odoo Help

0

How to get the current user id from an Odoo Website Web Controller ?

By
Slim BHIRI
on 11/21/16, 4:57 PM 457 views

How to get the current user id in an Odoo Web Controller ?

0
Slim BHIRI
On 11/28/16, 4:11 PM

Hi Yenthe,

In Odoo 8, inside a web controller it doesn't work for me and I'm using that codes instead :

request.uid

or

request.session.uid

Regards,
Slim

2

Yenthe

--Yenthe--
6960
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 11/22/16, 2:22 AM

Hi Slim,

You can get the user his id out of the environment its context like this:

http.request.env.context.get('uid')

Regards,
Yenthe

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 11/21/16, 4:57 PM
Seen: 457 times
Last updated: 11/30/16, 2:59 PM