[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
This commit is contained in:
Lucas Lefèvre
2020-03-31 09:26:00 +00:00
parent 5024d3a522
commit 09ea34ace7
+1 -1
View File
@@ -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