From a866452637ba2eb8b5b8ca17e916f8b30b94b0ad Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Wed, 1 Jul 2020 09:15:17 +0000 Subject: [PATCH] [FIX] hr_timesheet: Prevent the stoping timer when time dialog cancelled Currently, When some one start the timer and click on stop button at that time it was first stop the timer by super method and then open the time dialog so timer vanishes and the Start button is displayed again. After this commit, when click on stop button do not stop the timer by calling super method of mixin just open the dialog with minutes spent and on click of SAVE in dialog stop the time and unlink the related timer entry and on click of CANCEL of dialog it will not stop the timer. closes odoo/odoo#55744 Task-id: 2230217 X-original-commit: 96bc68be7f6eae7845c3c5c228b3af34a7f75864 Related: odoo/enterprise#12347 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_timesheet/wizard/project_task_create_timesheet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_timesheet/wizard/project_task_create_timesheet.py b/addons/hr_timesheet/wizard/project_task_create_timesheet.py index b919361822b..66b45196181 100644 --- a/addons/hr_timesheet/wizard/project_task_create_timesheet.py +++ b/addons/hr_timesheet/wizard/project_task_create_timesheet.py @@ -28,4 +28,5 @@ class ProjectTaskCreateTimesheet(models.TransientModel): 'user_id': self.env.uid, 'unit_amount': self.time_spent, } + self.task_id.user_timer_id.unlink() return self.env['account.analytic.line'].create(values)