Skip to content

Commit

Permalink
[IMP] hr_timesheet_overtime: Add roadmap
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed Jun 28, 2024
1 parent 4b84f25 commit 23a892b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
26 changes: 26 additions & 0 deletions hr_timesheet_overtime/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ Computes overtime hours according to employee's contracts.
.. contents::
:local:

Known issues / Roadmap
======================

There is a problem with the way this module handles rates for overtime. If the
rate ever changes, things will start to break.

At time of writing (2024-06-28), the way a rate is computed for a date is by
looking _exclusively_ at the corresponding day of the week. This should be more
robust.

Furthermore, when inserting hours worked, the actual hours worked get lost. You
(try to) write a value to ``unit_amount``, but an augmented value gets written
to the field instead. This is rather ugly.

We can improve this by relying on the computation of ``unit_amount`` in Odoo
≥16: create a new field ``hours_worked``, which contains the actual hours worked
sans rate. Then, compute ``unit_amount`` from ``hours_worked`` (in a more robust
fashion than is presently the case). In the interface, show ``hours_worked``
more prominently than ``unit_amount`` as the main editable field.

To make this module subsequently compatible with ``hr_timesheet_begin_end``,
``hours_worked`` must be computed from ``time_stop`` and ``time_start``, and
``unit_amount`` must use this module's computation method instead of
``hr_timesheet_begin_end``'s. The compatibility layer should go into its own
module.

Bug Tracker
===========

Expand Down
22 changes: 22 additions & 0 deletions hr_timesheet_overtime/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
There is a problem with the way this module handles rates for overtime. If the
rate ever changes, things will start to break.

At time of writing (2024-06-28), the way a rate is computed for a date is by
looking _exclusively_ at the corresponding day of the week. This should be more
robust.

Furthermore, when inserting hours worked, the actual hours worked get lost. You
(try to) write a value to ``unit_amount``, but an augmented value gets written
to the field instead. This is rather ugly.

We can improve this by relying on the computation of ``unit_amount`` in Odoo
≥16: create a new field ``hours_worked``, which contains the actual hours worked
sans rate. Then, compute ``unit_amount`` from ``hours_worked`` (in a more robust
fashion than is presently the case). In the interface, show ``hours_worked``
more prominently than ``unit_amount`` as the main editable field.

To make this module subsequently compatible with ``hr_timesheet_begin_end``,
``hours_worked`` must be computed from ``time_stop`` and ``time_start``, and
``unit_amount`` must use this module's computation method instead of
``hr_timesheet_begin_end``'s. The compatibility layer should go into its own
module.

0 comments on commit 23a892b

Please sign in to comment.