El 11/10/16 a les 03:28, Ryan ha escrit:
>
>
> 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
> please...
>
> z_group = fields.Char('Default Group')
>
>
> @staticmethod
> def default_zgroup():
> pool = Pool()
> User = pool.get('res.user')
> user = User(Transaction().context['user'])
> return user.groups
Here are returning user.group instances instead of string, which is the
expected behaviour of the Char fields. If you wan to return a string,
you can return the rec_names of the groups joined by comas using:
return ','.join([u.rec_name for r in user.groups])