From 6f0458147ff6fcf076d2e6aeb73343ba6cccc40b Mon Sep 17 00:00:00 2001 From: Mithilesh Rao Date: Mon, 7 Sep 2020 13:27:53 +0000 Subject: [PATCH] [IMP] hr_timesheet: Allow to cancel entry when using the timer on a task Prupose of the task is, if the user misclicks on the 'start' button to launch the timer, he doesn't have any option to discard the timer. So in this commit , added a 'delete' button so user can stop the timer from wizard. closes odoo/odoo#57316 Taskid: 2334036 Related: odoo/enterprise#13072 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_timesheet/wizard/project_task_create_timesheet.py | 3 +++ .../wizard/project_task_create_timesheet_views.xml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet/wizard/project_task_create_timesheet.py b/addons/hr_timesheet/wizard/project_task_create_timesheet.py index 66b45196181..eae94d737d7 100644 --- a/addons/hr_timesheet/wizard/project_task_create_timesheet.py +++ b/addons/hr_timesheet/wizard/project_task_create_timesheet.py @@ -30,3 +30,6 @@ class ProjectTaskCreateTimesheet(models.TransientModel): } self.task_id.user_timer_id.unlink() return self.env['account.analytic.line'].create(values) + + def action_delete_timesheet(self): + self.task_id.user_timer_id.unlink() diff --git a/addons/hr_timesheet/wizard/project_task_create_timesheet_views.xml b/addons/hr_timesheet/wizard/project_task_create_timesheet_views.xml index db26070c345..aea2be82687 100644 --- a/addons/hr_timesheet/wizard/project_task_create_timesheet_views.xml +++ b/addons/hr_timesheet/wizard/project_task_create_timesheet_views.xml @@ -13,7 +13,8 @@