Hello
would like to give group "A" for the created user, if the creator have group "B", for that i have created the following class :
class User(models.Model):
_inherit = 'res.users'
#this is the solution
@api.model
def create(self, vals):
res = super(User, self).create(vals)
if self.env.user.has_group('module.group_A'):
self.env['res.users'].create({
'groups_id': 'module.group_B',
})
return res
But i got this erreur:
You cannot create a new user from here.
To create new user please go to configuration panel.