[FIX] portal: bad ensure_one due to migration
This commit is contained in:
@@ -120,7 +120,6 @@ class PortalWizardUser(models.TransientModel):
|
||||
""" From selected partners, add corresponding users to chosen portal group. It either granted
|
||||
existing user, or create new one (and add it to the group).
|
||||
"""
|
||||
self.ensure_one()
|
||||
error_msg = self.get_error_messages()
|
||||
if error_msg:
|
||||
raise UserError("\n\n".join(error_msg))
|
||||
@@ -139,7 +138,7 @@ class PortalWizardUser(models.TransientModel):
|
||||
# create a user if necessary, and make sure it is in the portal group
|
||||
if not user:
|
||||
company_id = wizard_user.partner_id.company_id.id
|
||||
user_portal = self.sudo().with_context(company_id=company_id)._create_user()
|
||||
user_portal = wizard_user.sudo().with_context(company_id=company_id)._create_user()
|
||||
else:
|
||||
user_portal = user
|
||||
wizard_user.write({'user_id': user_portal.id})
|
||||
|
||||
Reference in New Issue
Block a user