[IMP] project: improve portal and project sharing UX
Before this commit: 1- project sharing task form: Internal users can't see and edit all fields. They need to go back to backend interface. Some users don't even know the difference between project sharing and backend, and the others need to navigate manually to that interface 2- portal tasks list view: Currently, the name of tasks will be cropped if it is too long. However, the user has no choice but to open the form view to get the full name of the task. This can be quite bothersome when each task has to be open individually in order to differentiate them 3- portal tasks list view: Currently, projects are displayed as tags After this commit: 1- we added a shortcut to redirect them in one click. 2- display the full name of the task on hover 3- display project as a normal field task-3186689 closes odoo/odoo#114531 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -1561,3 +1561,10 @@ class Task(models.Model):
|
||||
datetime.combine(fields.Date.from_string(date_from), time.min).replace(tzinfo=UTC),
|
||||
datetime.combine(fields.Date.from_string(date_to), time.max).replace(tzinfo=UTC)
|
||||
)
|
||||
|
||||
def action_redirect_to_project_task_form(self):
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': '/web#model=project.task&id=%s&action=%s&view_type=form' % (self.id, self.env.ref('project.action_view_my_task').id),
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<t t-call="project.portal_my_tasks_priority_widget_template"/>
|
||||
</td>
|
||||
<td>
|
||||
<a t-attf-href="/my/#{task_url}/#{task.id}?{{ keep_query() }}"><span t-field="task.name"/></a>
|
||||
<a t-attf-href="/my/#{task_url}/#{task.id}?{{ keep_query() }}"><span t-att-title="task.name" t-field="task.name"/></a>
|
||||
</td>
|
||||
<td>
|
||||
<t t-set="assignees" t-value="task.sudo().user_ids"/>
|
||||
@@ -87,7 +87,7 @@
|
||||
</t>
|
||||
</td>
|
||||
<td t-if="groupby != 'project'">
|
||||
<span class="badge rounded-pill text-bg-info mw-100 align-middle text-truncate" title="Current project of the task" t-esc="task.project_id.name" />
|
||||
<span title="Current project of the task" t-esc="task.project_id.name" />
|
||||
</td>
|
||||
<td t-if="groupby != 'stage'" class="text-end">
|
||||
<span t-attf-class="badge #{'text-bg-primary' if task.stage_id.fold else 'text-bg-light'} o_text_overflow" t-attf-title="#{task.stage_id.name}" t-esc="task.stage_id.name"/>
|
||||
|
||||
@@ -131,6 +131,11 @@
|
||||
attrs="{'invisible' : "[('user_ids', 'not in', [uid])]"}" 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 groups="base.group_user" role="status" class="alert alert-info alert-dismissible rounded-0 fade show d-print-none css_editable_mode_hidden">
|
||||
<div class="text-center">This is a preview of how the project will look when it's shared with customers and they have editing access.
|
||||
<a name="action_redirect_to_project_task_form" type="object"><i class="fa fa-arrow-right me-1"/>Back to edit mode</a>
|
||||
</div>
|
||||
</div>
|
||||
<sheet string="Task">
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<field name="display_parent_task_button" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user