HR

Employees and leave

MarketplacePeople and projectsVersion 0.1.0manifest

What it is for ​

A register of employees, departments and leave requests, with strict data classes: pay, bank details and national id are visible to managers only and health or union data only to a special reader group. Agents never see the sensitive classes.

What the package does and does not do ​

Employees, departments and leave requests. Personal data is classified strictly: pay, bank and national id are visible to managers only, and health and union data to the special reader group.

Models ​

hr_department ​

A team or department of the company

Read group: hr.user. Write group: hr.manager.

FieldKindData classPersonal dataGroupAgents seeDescription
nametextnonenohr.userin clearDepartment name
headtextpublic_directoryyeshr.usermaskedName of the department head
cost_centretextnonenohr.userin clearCost centre code used by finance

hr_employee ​

A person employed by the company

Read group: hr.user. Write group: hr.manager.

FieldKindData classPersonal dataGroupAgents seeDescription
nametextpublic_directoryyeshr.usermaskedFull name
job_titletextpublic_directoryyeshr.usermaskedJob title
work_emailtextpublic_directoryyeshr.usermaskedWork email address
work_phonetextpublic_directoryyeshr.usermaskedWork phone number
department_idref → hr_departmentnonenohr.userin clearThe department the person belongs to
reports_to_idref → hr_employeenonenohr.userin clearThe person's line manager
hired_ondateinternalyeshr.usermaskedFirst day of employment (YYYY-MM-DD)
contract_typeselect (permanent, fixed_term, contractor, intern)confidential_hryeshr.managerwithheldType of employment contract: permanent, fixed_term, contractor, intern
private_emailtextconfidential_hryeshr.managerwithheldPrivate email address
private_phonetextconfidential_hryeshr.managerwithheldPrivate phone number
home_addresslongtextconfidential_hryeshr.managerwithheldPrivate home address
birth_datedateconfidential_hryeshr.managerwithheldDate of birth (YYYY-MM-DD)
national_idtextconfidential_hryeshr.managerwithheldNational identity or social security number
emergency_contacttextconfidential_hryeshr.managerwithheldName and phone of the person to call in an emergency
salarymoneyfinancialyeshr.managerwithheldGross annual salary (minor currency units, e.g. cents)
bank_ibantextfinancialyeshr.managerwithheldBank account salary is paid into
union_memberboolspecial_categoryyeshr.special_readerwithheldWhether the person is a trade union member
work_permit_expirydatespecial_categoryyeshr.special_readerwithheldDate the work permit expires, for non-citizens (YYYY-MM-DD)
health_notelongtextspecial_categoryyeshr.special_readerwithheldHealth condition or disability relevant to the workplace
stateselect (onboarding, active, offboarded)nonenohr.userin clearEmployment status: onboarding, active, offboarded

hr_leave_request ​

A request for time off

Read group: hr.user. Write group: hr.user.

FieldKindData classPersonal dataGroupAgents seeDescription
employee_idref → hr_employeenonenohr.userin clearThe employee asking for time off
leave_kindselect (paid, unpaid, parental, study, other)confidential_hryeshr.userwithheldKind of leave: paid, unpaid, parental, study, other
start_ondateinternalyeshr.usermaskedFirst day of absence (YYYY-MM-DD)
end_ondateinternalyeshr.usermaskedLast day of absence (YYYY-MM-DD)
daysnumbernonenohr.userin clearWorking days requested
reasonlongtextconfidential_hryeshr.managerwithheldWhy the leave is requested
is_sick_leaveboolspecial_categoryyeshr.special_readerwithheldWhether the absence is due to illness
medical_notelongtextspecial_categoryyeshr.special_readerwithheldReference to the medical certificate, if any
stateselect (draft, requested, approved, refused)nonenohr.userin clearRequest status: draft, requested, approved, refused

Workflows ​

hr_employee ​

ActionMovesWho may run itApproval
hr_employee.activatestate: onboarding → activehr.managerno
hr_employee.offboardstate: active → offboardedhr.manageryes

hr_leave_request ​

ActionMovesWho may run itApproval
hr_leave_request.requeststate: draft → requestedhr.userno
hr_leave_request.approvestate: requested → approvedhr.manageryes
hr_leave_request.refusestate: requested → refusedhr.manageryes

Permission groups ​

Groups used by this app:

  • hr.manager
  • hr.special_reader
  • hr.user

Approval steps ​

Steps an agent can only propose:

  • hr_employee.offboard
  • hr_leave_request.approve
  • hr_leave_request.refuse

What agents can and cannot do ​

An agent can read, search, create and update records of this app, and run the actions that need no approval, within the permission groups of its token.

It can only propose these steps, and a person must approve them: hr_employee.offboard, hr_leave_request.approve, hr_leave_request.refuse, hr_department.delete, hr_employee.delete, hr_leave_request.delete.

Personal data is masked as placeholder tokens: hr_department.head, hr_employee.name, hr_employee.job_title, hr_employee.work_email, hr_employee.work_phone, hr_employee.hired_on, hr_leave_request.start_on, hr_leave_request.end_on.

These fields are withheld from agents entirely: hr_employee.contract_type, hr_employee.private_email, hr_employee.private_phone, hr_employee.home_address, hr_employee.birth_date, hr_employee.national_id, hr_employee.emergency_contact, hr_employee.salary, hr_employee.bank_iban, hr_employee.union_member, hr_employee.work_permit_expiry, hr_employee.health_note, hr_leave_request.leave_kind, hr_leave_request.reason, hr_leave_request.is_sick_leave, hr_leave_request.medical_note.

Dependencies ​

None.

Install ​

Install it from the Customize app (Marketplace), or from the command line:

bash
obop modules install-from hr

Needs a database and administrator rights.

Build your own ​

The module guide shows how apps like this one are written