Skip to content
Permalink
Browse files

[FIX] portal: remove company_id context key.

  • Loading branch information...
Feyensv committed Oct 7, 2019
1 parent 60efb57 commit 527c2c7fb5dec7f1215f748fb1a0f05d525c79ee
Showing with 3 additions and 4 deletions.
  1. +3 −4 addons/portal/wizard/portal_wizard.py
@@ -132,7 +132,7 @@ def action_apply(self):
company_id = wizard_user.partner_id.company_id.id
else:
company_id = self.env.company.id
user_portal = wizard_user.sudo().with_context(company_id=company_id)._create_user()
user_portal = wizard_user.sudo().with_company(company_id)._create_user()
else:
user_portal = user
wizard_user.write({'user_id': user_portal.id})
@@ -155,13 +155,12 @@ def _create_user(self):
""" create a new user for wizard_user.partner_id
:returns record of res.users
"""
company_id = self.env.context.get('company_id')
return self.env['res.users'].with_context(no_reset_password=True)._create_user_from_template({
'email': extract_email(self.email),
'login': extract_email(self.email),
'partner_id': self.partner_id.id,
'company_id': company_id,
'company_ids': [(6, 0, [company_id])],
'company_id': self.env.company_id.id,
'company_ids': [(6, 0, self.env.company_id.ids)],
})

def _send_email(self):

0 comments on commit 527c2c7

Please sign in to comment.
You can’t perform that action at this time.