Skip to content

Commit

Permalink
[FIX] tg_portal: User's 'allowed companies' fields is copied from def…
Browse files Browse the repository at this point in the history
…ault user
  • Loading branch information
kwhatk0k3 committed Nov 13, 2024
1 parent a97aad5 commit 33f05c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tg_portal/wizard/portal_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class PortalWizard(models.TransientModel):
# based on original _create_user from same wizard
def _create_user(self):
normalized_email = email_normalize(self.email)
default_user = self.env.ref("base.default_user")
user = (
self.env["res.users"]
.with_context(no_reset_password=True)
Expand All @@ -22,7 +23,7 @@ def _create_user(self):
user.write(
{
"company_id": self.env.company.id,
"company_ids": [(4, self.env.company.id)],
"company_ids": [(6, 0, default_user.company_ids.ids)],
}
)
return user

0 comments on commit 33f05c6

Please sign in to comment.