EH HR Document
Employee documents with live expiry tracking, on an audited HR platform.
Why this module
EH HR Document
Status that recomputes itself
Days to expiry and the valid, expiring or expired status are computed on read, not stored, so the figure is right every time you open the list even as the calendar advances. Nothing to recalculate, nothing to refresh.
Every change on the record
Create, write and delete are written to an append-only, hash-chained log shared across the platform. You can verify the chain on demand to show who recorded which document and when, without bolting on extra tooling.
Records that stay in their company
Each document is owned by a required company and cross-company writes are refused by default, even under sudo, unless an explicit audited override is used. No null-company records leaking between companies.
Day in the life
A licence that almost lapsed
An HR officer records a driver's licence with its expiry date; the document shows green as valid. Weeks later it crosses into the 30 day window and the nightly check posts a note on the document chatter that it expires soon, while the list flags the row amber. The officer renews it and updates the date before it ever turns red, and the whole sequence sits in the audit log.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
The daily check searches only documents whose expiry falls inside the forward 30 day window and posts a chatter note on each; it returns the count it touched, so a run with nothing due is a clean no-op rather than a failure.
Status and days to expiry are non-stored computes keyed on expiry date, so a document that tips from valid to expiring or expired overnight reads correctly the next morning with no stored value to drift or rebuild.
A document left without an expiry date is treated as never expiring: its status is shown as no expiry and it is excluded from the daily check rather than being flagged in error.
Reassigning a document to a company the user does not belong to is refused with an access error, even under sudo, and any permitted company change is itself written to the audit log with the affected record ids.
Each audit row hashes the previous row's hash, and appends are serialized with a transaction-scoped Postgres advisory lock so concurrent writes cannot fork the chain; a later edit to any row is caught by the on-demand chain check.
A document is tied to its employee with an on-delete cascade, so removing the employee removes their documents cleanly, and the deletions are recorded in the audit trail before the rows go.
What is inside
Built to do the job, end to end.
- The document register. Adds the eh.hr.document model: title, employee, document type (passport, visa or permit, licence, contract, certificate or other), official document number, issue date and expiry date, with list and form views and a menu under Employee Requests.
- Live expiry status. A days to expiry integer and a four-state status (no expiry, valid, expiring soon, expired) computed from the expiry date against a 30 day window, with the list colouring expiring rows amber and expired rows red.
- Daily expiry check. A code cron that runs once a day, finds documents entering the 30 day window and posts a dated note to each document's chatter. It is shipped active and isolated to this model.
- Platform audit and scoping. Inherits the platform's audited and company-aware mixins, so every change is captured in the hash-chained audit log and each record is locked to its owning company. mail.thread gives each document its own chatter.
- Role-based access. Three access levels out of the box: HR admin with full control, HR officer who can create and edit but not delete, and employee self-service with read-only visibility, all keyed to the platform's HR groups.
Honest about the edges
What this does not do, so nothing surprises you.
- This module records document metadata and dates, not the document file itself; there is no dedicated attachment or upload field, though the chatter accepts attachments like any Odoo record.
- The reminder is a note posted to the document's chatter by the daily cron; it does not send email or push notifications on its own.
- The expiring window is fixed at 30 days in code and is not exposed as a setting in this module.
- There is no approval workflow, escalation ladder or renewal process here; it tracks status, it does not route documents for sign-off.
- Document numbers are stored as free text and are not validated or checked for uniqueness.
- It depends on eh_hr_core and eh_hr_compat, so the audit log, company-scope rules and HR groups come from the platform rather than this module alone.
employee document management Odoo, document expiry tracking, passport visa licence tracker, HR document register, contract and certificate expiry, employee compliance documents, Odoo 16 HR documents, document expiry reminder cron, multi-company employee records, hash-chained HR audit log, self-hosted HR document module, LGPL-3 Odoo HR
Need this fitted to the way you work?
ERP Heritage delivers end to end Odoo work: Odoo Implementation, Customization and Development, Integration, Migration, Consultation, Support and Training. We help teams put this module into production, shape it to their process, and keep it running.
We work with businesses across Australia (Melbourne, Sydney, Brisbane, Perth, Adelaide, Canberra) and the Middle East (Dubai, Abu Dhabi, Riyadh, Jeddah, Doha, Kuwait City, Muscat). Start a conversation at erpheritage.com.au or email info@erpheritage.com.au.
Languages
Available in 19 languages
The interface ships translated out of the box. Switch language in Odoo and the fields, menus, and messages follow.
Please log in to comment on this module