diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-03-20 08:45:52 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-03-20 09:36:51 +0100 |
| commit | 4c692f1bb31766840ca3eca6a8e0faebd34cda1a (patch) | |
| tree | da164a5bd6d0541266c78f3c2074e15cca3aaa5d /addons/website_project_issue/models | |
| parent | da1f153d61d747d9357694382fe04f96c0ca886a (diff) | |
[FIX] website_project{_issue}: redirect from email
- Create a portal user
- Set an email address
- Create a project with tasks / issues
- Create a task / issue, set the portal user as follower => he should
have access to the task from URL `/my/task/<id>`.
- On an email received (e.g. when the user is set as follower), click on
'View Task'
The user is redirected to the chatter instead of `/my/task/<id>` or
`/my/issue/<id>`.
In method, `_redirect_to_record`, the record is browsed as `sudo`.
Therefore, in `get_access_action`, `self.env.user` is the admin.
We check the context to get the original user.
opw-1814577
Diffstat (limited to 'addons/website_project_issue/models')
| -rw-r--r-- | addons/website_project_issue/models/project_issue.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/website_project_issue/models/project_issue.py b/addons/website_project_issue/models/project_issue.py index d6d8916026a..ed5421924b5 100644 --- a/addons/website_project_issue/models/project_issue.py +++ b/addons/website_project_issue/models/project_issue.py @@ -13,7 +13,11 @@ class Issue(models.Model): """ Instead of the classic form view, redirect to website for portal users that can read the issue. """ self.ensure_one() - if self.env.user.share: + if self.env.context.get('uid'): + user = self.env['res.users'].browse(self.env.context['uid']) + else: + user = self.env.user + if user.share: try: self.check_access_rule('read') except exceptions.AccessError: |
