How to get the current user id in an Odoo Web Controller ?
To pytanie dostało ostrzeżenie
2
Odpowiedzi
26285
Widoki
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
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
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
|
1
lis 25
|
4863 | ||
|
|
4
lis 25
|
5056 | ||
|
|
1
cze 23
|
4431 | ||
|
|
0
lip 22
|
3711 | ||
|
Odoo? Why this new name?
Rozwiązane
|
|
3
wrz 21
|
27991 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo