From b0421b3aab4d7132f345e61a1b0f2dfdb16c7f2b Mon Sep 17 00:00:00 2001 From: Raouf Date: Tue, 7 Mar 2023 09:07:37 +0000 Subject: [PATCH] [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) --- addons/project/models/project_task.py | 7 +++++++ .../views/project_portal_project_task_templates.xml | 4 ++-- .../project/views/project_sharing_project_task_views.xml | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/project/models/project_task.py b/addons/project/models/project_task.py index 038e5bd926a..0f9156c9ee0 100644 --- a/addons/project/models/project_task.py +++ b/addons/project/models/project_task.py @@ -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', + } diff --git a/addons/project/views/project_portal_project_task_templates.xml b/addons/project/views/project_portal_project_task_templates.xml index a3b83251c85..b1ed9348bca 100644 --- a/addons/project/views/project_portal_project_task_templates.xml +++ b/addons/project/views/project_portal_project_task_templates.xml @@ -67,7 +67,7 @@ - + @@ -87,7 +87,7 @@ - + diff --git a/addons/project/views/project_sharing_project_task_views.xml b/addons/project/views/project_sharing_project_task_views.xml index e1a15756474..99072f7ad88 100644 --- a/addons/project/views/project_sharing_project_task_views.xml +++ b/addons/project/views/project_sharing_project_task_views.xml @@ -131,6 +131,11 @@ attrs="{'invisible' : "[('user_ids', 'not in', [uid])]"}" data-hotkey="q"/> +
+
This is a preview of how the project will look when it's shared with customers and they have editing access. + Back to edit mode +
+