[FIX] website: create public user in sudo

If new user is not in the current company, once created you will not be able to read it and
a traceback is raised.
This commit is contained in:
Jeremy Kersten
2018-08-29 15:18:13 +02:00
parent f22e61dc74
commit e24fedb757
+1 -1
View File
@@ -26,7 +26,7 @@ class Company(models.Model):
if public_users_for_website:
return public_users_for_website[0]
else:
return self.env.ref('base.public_user').copy({
return self.env.ref('base.public_user').sudo().copy({
'name': 'Public user for %s' % self.name,
'login': 'public_company_%s' % self.id,
'company_id': self.id,