addons-cm/hr_timesheet_sheet_delete_cascade/readme/DESCRIPTION.rst

19 lines
1 KiB
ReStructuredText

In ``hr_timesheet_sheet``, deleting a timesheet sheet does not delete the
timesheet entries it contains: they are left behind with an empty ``Sheet``
field, invisible from any sheet and hard to find again.
This module makes the deletion of a sheet cascade to its timesheet entries,
behind a confirmation wizard that states beforehand how many entries and how
many hours are about to disappear. Invoiced entries are never deleted: a sheet
that contains one cannot be deleted at all.
Because a sheet also contains the entries generated by approved time off, the
module makes that case an explicit company policy: either the time off request
is kept untouched and only its entries are detached from the sheet (the
default), or the request is cancelled and the days are restored to the
employee balance.
Turning a harmless ``unlink()`` into a destructive one is only safe if the
record rules are in place first, so the module also adds the record rules that
``hr_timesheet.sheet`` is missing: without them any internal user can delete
the sheet of any other employee.