I want to get and display current login user name in qweb report in odoo. Can someone please tell me, how can i do it or give me some example code. I'll be very thankful...!
Asked
Active
Viewed 9,879 times
6
M Tahir Noor
- 443
- 2
- 10
- 31
2 Answers
10
The request variable will always be available in a qweb context. You can use request.env.user object. Hence in a report, you can insert something like: <span t-esc="request.env.user.name"/>.
macdelacruz
- 607
- 5
- 20
7
You can use "user" in your qweb template to get details of current login user, it is record of res.users.
To print the user name
<span t-esc="user.name"></span>
Click here to see more
Emipro Technologies Pvt. Ltd.
- 14,598
- 5
- 45
- 75