From d16aa4cd396e13749d12fa8e55f80f0fcc62f686 Mon Sep 17 00:00:00 2001 From: Barad Mahendra Date: Mon, 25 Nov 2019 11:24:45 +0000 Subject: [PATCH] [IMP] (hr, sale)_timesheet, pad(_project): improve project general UX Purpose fo the task is to improve the UX of timesheet, project and task. Done the chages for below point: - improve the stage demo data to unified the project stage - on the task timesheet 'sub-tasks hours spent' should be clickable and on click, it will display the list of subtask timesheet. - display in warning tasks for which Remaining Hours < 0 if Planned Hours > 0 in task list view - improve the settings of collabrative pad and planning and project form view Task-2129052 closes odoo/odoo#41092 Closes: #41092 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_timesheet/models/project.py | 10 ++++ addons/hr_timesheet/views/project_views.xml | 6 ++- addons/pad/models/res_config_settings.py | 4 +- addons/pad/static/src/xml/pad.xml | 2 +- .../pad/views/res_config_settings_views.xml | 34 ++++++------- addons/pad_project/models/project.py | 2 +- addons/pad_project/views/project_views.xml | 16 ++++-- .../views/res_config_settings_views.xml | 7 ++- addons/project/data/project_data.xml | 6 +-- addons/project/data/project_demo.xml | 4 +- addons/project/models/res_config_settings.py | 2 +- .../sale_timesheet/data/sale_service_demo.xml | 51 ++++--------------- 12 files changed, 68 insertions(+), 76 deletions(-) diff --git a/addons/hr_timesheet/models/project.py b/addons/hr_timesheet/models/project.py index 9f4708eee55..ade6fc66b6b 100644 --- a/addons/hr_timesheet/models/project.py +++ b/addons/hr_timesheet/models/project.py @@ -135,6 +135,16 @@ class Task(models.Model): for task in self: task.display_timesheet_timer = task.allow_timesheets and task.project_id.allow_timesheet_timer and task.analytic_account_active + def action_view_subtask_timesheet(self): + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': _('Timesheets'), + 'res_model': 'account.analytic.line', + 'view_mode': 'list,form', + 'domain': [('project_id', '!=', False), ('task_id', 'in', self.child_ids.ids)], + } + def write(self, values): # a timesheet must have an analytic account (and a project) if 'project_id' in values and self and not values.get('project_id'): diff --git a/addons/hr_timesheet/views/project_views.xml b/addons/hr_timesheet/views/project_views.xml index f5ade504c73..39e156f157e 100644 --- a/addons/hr_timesheet/views/project_views.xml +++ b/addons/hr_timesheet/views/project_views.xml @@ -178,7 +178,8 @@ - +