[FIX] project: show 'Assign To Me' only if the user is not assigned

Before this commit, when the task has a user assigned to a task and the
current user wants to assign himself to this task. He cannot see the
'Assign To Me' button because this button is only visible if the
`user_ids` field is empty.

This commit changes the visibility of this button to show this button
only if the current user is not yet assigned to the task.

task-2633229

closes #77156

X-original-commit: cfba241bada2b3690b4303b7e01747301925d162
This commit is contained in:
Xavier BOL (xbo)
2021-11-05 17:15:47 +01:00
parent adf3aca403
commit 614657d799
+2 -2
View File
@@ -809,7 +809,7 @@
<field name="rating_count" invisible="1"/>
<header>
<button name="action_assign_to_me" string="Assign to Me" type="object" class="oe_highlight"
attrs="{'invisible' : [('user_ids', '!=', [])]}" data-hotkey="q"/>
attrs="{'invisible' : &quot;[('user_ids', '=', uid)]&quot;}" data-hotkey="q"/>
<field name="stage_id" widget="statusbar" options="{'clickable': '1', 'fold_field': 'fold'}" attrs="{'invisible': [('project_id', '=', False), ('stage_id', '=', False)]}"/>
</header>
<div class="alert alert-info oe_edit_only mb-0" role="status" attrs="{'invisible': ['|', ('recurring_task', '=', False), ('recurrence_id', '=', False)]}">
@@ -1100,7 +1100,7 @@
<t t-else="">
<br/>
<span class="font-italic text-muted"><i class="fa fa-lock"></i> Private</span>
</t>
</t>
<br />
<t t-if="record.partner_id.value">
<span t-if="!record.partner_is_company.raw_value">