odoo/enterprise#16084

Created by Fun Services, Prakash Prajapati (ppr)
Merged at 482e3335052a93e6a4b66589074f0dc6bd8d92f7

Statuses:

label
odoo-dev:master-timer-syc-ppr
head
f00e6895cf652f7ca492dc6bb2534bd230883b41
merged
1 month ago by Fun Services, Xavier Bol (xbo)
odoo/odoo odoo/enterprise odoo/upgrade odoo/upgrade-util
master #136946 #65414 #16084 #2208 #51

[MERGE] timer,*: Align timer of tasks/tickets with timer header

  • = helpdesk_timesheet,timesheet_grid,industry_fsm{_sale}

PURPOSE

Currently, the timer on tasks/tickets works "independently" from the timer header
of the Timesheets app. For instance, if the timer was launched from a task,
it is not reflected in the Timesheets app. The goal of this task to make these
two behaviors consistent.

Implementation details

Uniform the using of timer

The main goal is to directly link the timer on the timesheet and so the
will be generated when a timer is started. Also, the timer has to be
linked to the task/ticket to be able to stop the timer in the related
task/ticket (if the timesheet is linked to task/ticket or if the timer
is launched in a task/ticket). To do that, a new mixin called
timer.parent.mixin will be used for the task/ticket instead of
timer.mixin to keep the functionalities as before and in the
timer.timer, 2 new fields will be added to linked the task/ticket on
the timer.

Replace fields created to display the buttons for timer by domain

Before, some boolean fields are created to display the right button for
the timer. Now, those boolean fields have been removed and the domain of
those buttons has been updated to keep the same behavior as before even
if those fields will no longer exist.

Align timer on tasks/tickets with timer header

Use the new mixin in project.task and helpdesk.ticket models
instead of timer.timer and adapt the code to be able to start
and stop the timer as before.

Remove the project.task.create.timesheet and helpdesk.ticket.create.timesheet wizards

Since a timesheet will be automatically generated when a timer is started
those wizards are no longer necessary since it will no longer create a
timesheet since it will already exist when the user stops the timer.

Remarks

The timer has been uniform to have the same behavior in the Timesheets app
and in project.task and helpdesk.ticket form views. More precisely,
the behavior in the Timesheets app will be kept and so, the pause button
will be removed in project.task and helpdesk.ticket. The user could
only starts and stops the timer.

Also, before the user could start a timer in helpdesk.ticket and at the
same time, starts a timer in project.task and/or in Timesheet. Now, since
the main link on the timer will always be with the timesheet, it means only
one timer can be started in the same time. That is, if the timer is launched
on a ticket, the user will can see a timer is running in the Timesheet app but
if he starts a timer on a task via the project.task form view or in another
timesheet in Timesheet app, the existing timer will be stopped and removed before
starting the new timer.

task-2276015