Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: retrieve user id (uid)

by
Naresh Soni
- 12/01/2016 11:13:32
True, that will depend on the use case needed !

Regards,
Naresh Soni
Founder and Consultant
Cozy Business Solutions Pvt. Ltd
+91 8866 370537



On 1 December 2016 at 20:03, k.kinateder@plustron.de <k.kinateder@plustron.de> wrote:

Hi,

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

regards,
Karsten


Am 01.12.2016 um 15:27 schrieb Naresh Soni:
Hi 

You can get from self._uid or self.env.args

Regards,
Naresh Soni
Founder and Consultant
Cozy Business Solutions Pvt. Ltd
+91 8866 370537



On 1 December 2016 at 18:53, Christian Valsecchi <christian.valsecchi@outlook.com> wrote:

Hi there,

   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

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe