Skip to content

Commit

Permalink
[FIX] auth_signup: Server Error when sending message on task with portal
Browse files Browse the repository at this point in the history
- Let's consider a product P (invocing policy based on timesheet and creating new task)
- Create a quotation with the product P for a customer with portal access CPU
- Confirm it (A new task T is created)
- Go to T and add a follower (who is another portal user PU (third party)) in the task
  but uncheck the box to send him an email
- Connect to the portal with PU
- Go to T and send a message

Bug:

A server error was raised.

opw:2270074

closes odoo#52675

X-original-commit: 2a924b4
Signed-off-by: Simon Goffin (sig) <[email protected]>
  • Loading branch information
simongoffin committed Jun 9, 2020
1 parent f80613f commit c8832b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/auth_signup/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def signup_get_auth_param(self):

allow_signup = self.env['res.users']._get_signup_invitation_scope() == 'b2c'
for partner in self:
if allow_signup and not partner.sudo().user_ids:
partner = partner.sudo()
partner = partner.sudo()
if allow_signup and not partner.user_ids:
partner.signup_prepare()
res[partner.id]['auth_signup_token'] = partner.signup_token
elif partner.sudo().user_ids:
elif partner.user_ids:
res[partner.id]['auth_login'] = partner.user_ids[0].login
return res

Expand Down

0 comments on commit c8832b4

Please sign in to comment.