Skip to content
Snippets Groups Projects
Unverified Commit 7dfc7925 authored by Odoo's Mergebot's avatar Odoo's Mergebot Committed by GitHub
Browse files

[MERGE] hr_timesheet: Improve Timer, Access Rights and Validation


Access rights
=============

Purpose
-------

Currently, the lowest access right level for Timesheets allows a user
to see the timesheets from all employees. Some companies do not want
to have this information shared.

As we already have three levels of access rights, creating a new one
would be too much. Instead, we are using this opportunity to
clean/simplify the current access right levels.

Specification
-------------

Remove the current access rights and replace them with the following:
- 'See own timesheets' the user can:
    - read/write/create/delete his own timesheets only
    - cannot timesheet on projects whose Visibility is set on
      'Invited employees' if the user is not a follower
    - see the 'My Timesheets' and the 'Timesheet App' menus
- 'See all timesheets' the user can:
    - read/write/create/delete all timesheets
    - cannot see the Timesheets of Projects whose Visibility is set
      on 'Invited employees' if the user is not a follower
    - see the 'My Timesheets' + 'All Timesheets' + 'Timesheet App' +
      'To Validate' menus
    - validate the timesheets of whom he is the 'Timesheet
      Responsible' or the 'Manager'
- 'Administrator' the user can:
    - read/write/create/delete all timesheets
    - see all menus
    - validate the Timesheets of all employees
- Write tests

New Validation Process
======================

Purpose
-------

Currently, timesheets are validated by employees as a whole. However,
as a manager, it is difficult to evaluate the timesheets of an
employee for projects you know nothing about. Therefore, it would make
more sense for a manager to validate the timesheets of his projects
and to leave the rest to the other managers.

In addition, having a date on the employees leaves room for error and
performance issues, so we are introducing a new checkbox at the
timesheet level.

Specification
-------------

Remove the 'Timesheets Validation Date' field on the employee
- replace it with a 'Timesheet Validated' checkbox (hidden field) on
  the timesheet entry
    - By default, this field is set to false
    - Once the manager validates the timesheets, switch the field to
      true
- Filtering on 'Validated' timesheets should display timesheets for
  which 'Timesheet Validated' is true
- Filtering on 'Non-Validated' timesheets should display timesheets
  for which 'Timesheet Validated' is false

Rename the title of the validation menus into:
- To Validate > Last Weeks -> Timesheets from Last Week to Validate
- To Validate > Last Month -> Timesheets from Last Month to Validate

Grid view: display projects on which the user timesheeted in the
past 30 days (group_expand), or the employees who timesheeted in the
past 30 days for the 'To Validate' menus)

Open the 'To Validate' menus on the oldest non-validated timesheet
you can find.

Clicking on 'Validate' should validate all the timesheets displayed
on the screen. List all the elements displayed in the view based on
the group by applied in the 'Validate the timesheets' modal.

When validating timesheets, bypass timesheets that were already
validated in the past in order to avoid performance issues

Timer list
==========

Purpose
-------

Have an overview of the timesheets you need to do during the day.
Easily track time spent on tasks using the timer instead of having to
write down somewhere at what time you started an activity. Allow more
flexibility if an activity if interrupted by another one (so you
don't need to do mental arithmetic to determine how much time the
first activity took substracted by the time spent on the second
activity).

Specification
-------------

- Move the time from fsm to hr_timesheet.
- Add fa-play-circle and fa-stop-circle icons in the 'My Timesheets'
  menu:
    - on the left of the 'Duration' field in the list view
    - on the top right corner of the kanban card in the kanban view
    - on the right of the first column in the grid view
- Display these icons
    - for non-validated timesheets only
    - if the Encoding Unit is Hours
- Clicking on the play button should start and display the timer and
   switch to the stop icon
- Clicking on the stop button should halt and stop displaying the
  timer and switch to the play icon
- While the timer is running, the 'Duration' field should not
  be editable
- Only one timer can run at the same time. If the user clicks on the
  start button of timesheet B while the timer is running for
  timesheet A, timesheet B should start and timesheet A should stop.

Time selection when invoicing
=============================

Purpose
-------

Allow selecting a timeframe to invoice when the user is invoicing on
a periodical basis. For instance, the user invoices each time at the
end of the month. For some reason (he got sick, there was a bank
holiday...), he only invoices of the 4th of the following month.
Now the timesheets that are about to be invoiced include some that
were recorded in the meantime.

Specification
-------------

- Add an 'Invoice timesheets up to mm/dd/yyyy' field on the Invoice
  Creation modal
    - display this field only when creating an Invoice for a Service
      whose Invoicing Policy is on 'Timesheets on tasks'
    - not required
    - Set today's date by default
    - if this field is set, the quantity to invoice should only
      include the not yet invoiced (and validated) timesheets up to
      this date (included)
    - if this field is not set, include all not yet invoiced (and
      validated) timesheets without distinction.
    - Add the following tooltip: Only timesheets not yet invoiced
      (and validated, if applicable) up to this date included will be
      invoiced. If no date is indicated, all timesheets not yet
      invoiced (and validated, if applicable) will be invoiced
      without distinction.

Miscellaneous
=============

Purpose
-------

Small usability improvements.

- Move 'Create SO from Task' to sale_timesheet -> Means Enterprise to
  Community).
- Add the pivot view to the 'All Timesheets' menu
- Add the 'Today' button on the grid view of all menus (see the
  Reporting > Timesheets by Project menu for reference)

closes odoo/odoo#40495

Taskid: 2088586
Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: default avatarLucas Lefèvre <lul@odoo.com>
Co-authored-by: default avatarYannick Tivisse <yti@odoo.com>
parents ffd2502f 1bf2bfd2
No related branches found
No related tags found
No related merge requests found
Showing
with 716 additions and 87 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment