[FIX] project: remove "I take it" from task following email header

Current behaviour:
On a brand new task with no assignees, when we add an user to follow
the task with an email, there is a link "I take it" that is supposed
to assign the newly following user as the assignee of the task. This
link is dead, returning a 404.

Expected behaviour:
Either correct the link, or remove it from the email header.

Steps to reproduce:
- Install Project
- Create a task, with no assignees
- Add a new follower to the task with Send Email checked.
- Check the outgoing email, and click on the link "I take it".
- 404 response

Reason for the problem:
The route which we were using for this `/mail/assign` doesn't exist
anymore since version 15. This was an intended design change, to
remove noice. The user can click on "See task" and assign himself on
there.

Fix:
Remove the "I take it" link from the email header.

Affected versions:
- 15.0
- saas-15.2
- 16.0
- saas-16.1
- saas-16.2
- master

opw-3276036

closes odoo/odoo#119920

X-original-commit: 2d3134381c23675199bd8e14fafb1804d54339e6
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
This commit is contained in:
Victor Piryns (pivi)
2023-04-27 16:10:32 +02:00
parent f22961ad07
commit 1979e2671f
2 changed files with 0 additions and 11 deletions
-6
View File
@@ -2265,12 +2265,6 @@ msgstr ""
msgid "How’s this project going?"
msgstr ""
#. module: project
#. odoo-python
#: code:addons/project/models/project.py:0
#, python-format
msgid "I take it"
msgstr ""
#. module: project
#: model:ir.model.fields,field_description:project.field_project_collaborator__id
-5
View File
@@ -1222,15 +1222,10 @@ class Task(models.Model):
if not self:
return groups
local_msg_vals = dict(msg_vals or {})
self.ensure_one()
project_user_group_id = self.env.ref('project.group_project_user').id
new_group = ('group_project_user', lambda pdata: pdata['type'] == 'user' and project_user_group_id in pdata['groups'], {})
if not self.user_ids and not self.is_closed:
take_action = self._notify_get_action_link('assign', **local_msg_vals)
project_actions = [{'url': take_action, 'title': _('Assign to me')}]
new_group[2]['actions'] = project_actions
groups = [new_group] + groups
if self.project_privacy_visibility == 'portal':