diff --git a/energy_communities/models/res_users.py b/energy_communities/models/res_users.py index 08eed5b88065ee1c7fab8eff5bbf40f7f0c3f763..c6d1dd68694618ba18993bd92a2773b0c1c495c2 100644 --- a/energy_communities/models/res_users.py +++ b/energy_communities/models/res_users.py @@ -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 diff --git a/energy_communities/wizards/assign_admin_wizard.py b/energy_communities/wizards/assign_admin_wizard.py index 2bf9ff89a07d35641775684e973f4af0f97c89ab..fad683081b7600017eaa4742b426f06e9bd4613c 100644 --- a/energy_communities/wizards/assign_admin_wizard.py +++ b/energy_communities/wizards/assign_admin_wizard.py @@ -34,6 +34,7 @@ class AssignAdminWizard(models.TransientModel): company = self.env['res.company'].browse(company_id) company.add_ce_admin(user) + user.make_internal_user() return True