addons-cm/hr_timesheet_sheet_no_review/readme/USAGE.rst

35 lines
2 KiB
ReStructuredText

Once installed, the review buttons are gone from the timesheet sheet form and
kanban; the ``Submitted``, ``To Review`` and ``Reviewer`` entries are gone from
the sheet search view; the ``Not Submitted`` filter is gone from the timesheet
search view; the department kanban no longer counts the sheets to approve; and
the ``To Review`` and ``Timesheets to Submit`` menus are deactivated.
To release the sheets that were left frozen by the review workflow, go to
*Timesheets > Timesheets > Unfreeze Pending Sheets*. The wizard first shows how
many sheets, how many timesheet entries and how many hours are about to be
released. Confirming sets those sheets back to draft and clears their reviewer.
The wizard releases exactly the sheets it listed when it was opened, and the
confirmation message counts them. A sheet frozen by somebody else while the
dialog was on screen is not released: it shows up the next time the wizard is
opened. Only the frozen sheets the user can see are listed, so on a
multi-company database the figures follow the company switcher.
Installing the module never changes the state of a sheet on its own: unfreezing
is always an explicit decision of the timesheet manager. Running the wizard
twice is safe — the second run reports zero sheets and changes nothing.
Take a backup before the first run: the operation touches every frozen sheet at
once and the reviewer of the approved ones is lost.
To decide which sheets count as frozen, override
``hr_timesheet.sheet._unfreeze_domain()``. For instance, an installation that
wants to keep its approved sheets as historical record can narrow it down to
``[("state", "=", "confirm")]``. The domain is applied twice: once to list the
sheets in the dialog, and again when the button is pressed, so a sheet it keeps
out is never released.
``hr_timesheet.sheet._unfreeze_sheets()`` takes an optional recordset. Called
with no argument it releases every frozen sheet, as before; called with a
recordset it releases only those of them that the domain still considers
frozen.