Skip to content
Snippets Groups Projects
Commit 5de1468c authored by Benjami's avatar Benjami
Browse files

wip :construction: : Add internal user role when creates an admin

parent f6d23fae
No related branches found
No related tags found
2 merge requests!253[REL] Release 06/11/23,!191V1 imrpvements to CompanyEasyCreation wizard (CRM Lead execution)🙋‍
......@@ -225,3 +225,13 @@ class ResUsers(models.Model):
raise exceptions.UserError(
_('Something went wrong. Mail can not be sended. More details: {}').format(response.json())
)
def make_internal_user(self):
# TODO: Require rebase new roles branch
pass
# self.env["res.users.role.line"].sudo().create({
# "user_id": self.id,
# "active": True,
# "role_id": role.id,
# "company_id": self.id,
# })
\ No newline at end of file
......@@ -31,6 +31,7 @@ class AssignAdminWizard(models.TransientModel):
raise ValidationError(_('Company not found'))
company = self.env['res.company'].browse(company_ids[0])
company.add_ce_admin(user)
user.make_internal_user()
return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment