[FIX] auth_signup: Not possible to send message in a task from the portal

Steps to reproduce:
- Let's consider the portal user Pu, the project Pr and the task Ta
- Add Pu as a follower of Pr
- Log as Pu and open Ta
- Try to post a message

Bug:

An access error was raised due to the rule "res_partner: portal/public: read
access on my commercial partner".

opw:2070320

closes odoo/odoo#36960

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2019-09-17 13:07:20 +00:00
parent 80132ad9a6
commit d3d21d2a64
+1 -1
View File
@@ -109,7 +109,7 @@ class ResPartner(models.Model):
allow_signup = self.env['res.users']._get_signup_invitation_scope() == 'b2c'
for partner in self:
if allow_signup and not partner.user_ids:
if allow_signup and not partner.sudo().user_ids:
partner = partner.sudo()
partner.signup_prepare()
res[partner.id]['auth_signup_token'] = partner.signup_token