Technical mailing list archives
Re: retrieve user id (uid)by
I would prefer to use the uid from context, cause a model can be called with sudo. So self._uid and self.env.args not represents the current user context.
use self._context['uid'] to get the uid from logged in user
You can get from self._uid or self.env.args
On 1 December 2016 at 18:53, Christian Valsecchi <email@example.com> wrote:
We need to retrieve the user id of the logged user in a function in the sale order module.
We need this to get values from another table.
We tried the use self, but is blank. Same issue with the ‘uid’ function parameter.
We also tried to create a function (to retrieve the user id), again no luck.
Any ideas from anybody?
Thanks a lot for your help
Post to: mailto:expert-framework@mail.
Post to: mailto:firstname.lastname@example.org