[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) <yti@odoo.com>
This commit is contained in:
Prakash Prajapati
2020-08-11 11:32:52 +00:00
parent ac6c3901e2
commit a866452637
@@ -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)