5
votes

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...!

2

2 Answers

5
votes

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

9
votes

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"/>.