From 09ea34ace7835c40be69573e4201b17cf4494b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Fri, 20 Mar 2020 11:16:12 +0000 Subject: [PATCH] [IMP] hr_timesheet: Always display timer button in list view Purpose ======= It might look weird if the play button is displayed on some lines and not others. It might seem even weirder if we have the Timer functionalities (such as the timer bar we'll introduce with task 2217930) available even though the timer is disabled on all projects. In this case, if we wanted something clean, we would need to introduce a setting to disable the feature in Timesheets as well, but that seems overkill. At last, you may not want the timer on the task form view but find it still useful in the Timesheets app. Specification ============= Always display the start button, even if allow_timsheet_timer is False on the selected project. Task 2204084 --- addons/hr_timesheet/models/hr_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py index 324ece59f25..0e206e27d25 100644 --- a/addons/hr_timesheet/models/hr_timesheet.py +++ b/addons/hr_timesheet/models/hr_timesheet.py @@ -199,7 +199,7 @@ class AccountAnalyticLine(models.Model): def _compute_display_timer(self): uom_hour = self.env.ref('uom.product_uom_hour') for analytic_line in self: - analytic_line.display_timer = analytic_line.encoding_uom_id == uom_hour and analytic_line.project_id.allow_timesheet_timer + analytic_line.display_timer = analytic_line.encoding_uom_id == uom_hour def action_timer_start(self): """ Start a timer if it isn't already started and the