El 08/10/16 a les 12:07, Ryan ha escrit:
Thanks Sir Cedric,

Just a newbie here, just a month ago...

Can you please show me the code for creating a query to check the user's
id to get his group.
does the user group can be found on 'res_group'? or res_user-res_group?
You have to browse the user with the id from the context of transaction user and then read it's group properties. Something like (sorry but writting from memory):

pool = Pool()
User = pool.get('res.user')
user = User(Transaction().context['user']
user.groups # This is a tuple of res.group instances for each group of the user.

Hope it helps.

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/06bbf08d-a3a9-da8b-7a43-4fc15d7ebea0%40koolpi.com.

Reply via email to