Skip to content
Snippets Groups Projects
Commit c9da1571 authored by Xavier Bol (xbo)'s avatar Xavier Bol (xbo) Committed by Yannick Tivisse
Browse files

[IMP] hr_timesheet: add timer into list and kanban views for timesheets

TaskID: 2088586

Timer in the list and kanban views :
----------------------------------
In kanban and list views, It's possible to update the 'unit_amount'
field with a timer. The user can easily launch the timer in these views
for one of his timesheets.
One timesheet can be launched at the same time, when the user start a
timer for a timesheet and start another timer for another timesheet, the
first timer stop and the new timer start.

The timer is usable only if the encoding unit is 'Hours' and the
timesheet is not validated. To do this : a new computed field 'display_timer'
is created in account.analytic.line, this field is set to True is the
encoding unit is 'Hours'. With this field, we can easily hide and display
the timer in different views.

The user can only use the timer for his timesheets. Because the user
with the access rights to see all timesheets might launch and/or stop a timer of a
timesheet of other user. That is the timer must be accessed only in 'My Timesheets' menu.

Add pivot view for 'All timesheets' menu.

Creation a timer_mixin :
----------------------
With this timer mixin, we can have a generic timer to use in other
models that they need to use a timer like account.analytic.line and
project.task models
The timer in account.analytic.line model has changed to use the timer
mixin.

Specific behaviour of the timer :
-------------------------------
When the user use the timer and the minutes spent with the timer is less
than 1 minute, we don't add in unit_amount of timesheet. If the
unit_amount is equals to 0 and minutes spent of timer is less than 0.
Then the timesheet created by the timer is deleted because it is useless to
have a timesheet with unit_amount set on 0.

Misc :
----
Add some styles for the timer button and for the 'unit_amount' field when the
timer is running.

remove duplicated fields in tree view (record
id='timesheet_view_tree_user')
parent 2f20b943
Branches
Tags
No related merge requests found
Showing
with 548 additions and 67 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment