On Sunday, October 9, 2016 at 3:00:04 PM UTC+8, Ryan wrote:
> Thanks Sir Sergi.
> I'll try it later and update this trend asap.
> sorry... but I got blank result on this: please see code below. any help
z_group = fields.Char('Default Group')
pool = Pool()
User = pool.get('res.user')
user = User(Transaction().context['user'])
> Best Regards...
> On Saturday, October 8, 2016 at 9:43:20 PM UTC+8, Sergi Almacellas
> Abellana wrote:
>> 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
>> > 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
>> Twitter: @pokoli_srk
You received this message because you are subscribed to the Google Groups
To view this discussion on the web visit