---
title: "HR"
description: "Empleados y ausencias. Cada aplicación es un módulo sobre un único modelo de datos."
canonical: "https://obop-platform.sliplane.app/es/apps/hr/"
lang: "es"
---

# HR

## Para qué sirve

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.

## Qué hace y qué no hace el paquete

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.

## Modelos

### `hr_department`

A team or department of the company

Grupo de lectura: `hr.user`. Grupo de escritura: `hr.manager`.

| Campo | Tipo | Clase de datos | Datos personales | Grupo | Los agentes ven | Descripción |
|---|---|---|---|---|---|---|
| `name` | text | `none` | no | `hr.user` | en claro | Department name |
| `head` | text | `public_directory` | sí | `hr.user` | enmascarado | Name of the department head |
| `cost_centre` | text | `none` | no | `hr.user` | en claro | Cost centre code used by finance |

### `hr_employee`

A person employed by the company

Grupo de lectura: `hr.user`. Grupo de escritura: `hr.manager`.

| Campo | Tipo | Clase de datos | Datos personales | Grupo | Los agentes ven | Descripción |
|---|---|---|---|---|---|---|
| `name` | text | `public_directory` | sí | `hr.user` | enmascarado | Full name |
| `job_title` | text | `public_directory` | sí | `hr.user` | enmascarado | Job title |
| `work_email` | text | `public_directory` | sí | `hr.user` | enmascarado | Work email address |
| `work_phone` | text | `public_directory` | sí | `hr.user` | enmascarado | Work phone number |
| `department_id` | ref → hr_department | `none` | no | `hr.user` | en claro | The department the person belongs to |
| `reports_to_id` | ref → hr_employee | `none` | no | `hr.user` | en claro | The person's line manager |
| `hired_on` | date | `internal` | sí | `hr.user` | enmascarado | First day of employment (YYYY-MM-DD) |
| `contract_type` | select (permanent, fixed_term, contractor, intern) | `confidential_hr` | sí | `hr.manager` | retenido | Type of employment contract: permanent, fixed_term, contractor, intern |
| `private_email` | text | `confidential_hr` | sí | `hr.manager` | retenido | Private email address |
| `private_phone` | text | `confidential_hr` | sí | `hr.manager` | retenido | Private phone number |
| `home_address` | longtext | `confidential_hr` | sí | `hr.manager` | retenido | Private home address |
| `birth_date` | date | `confidential_hr` | sí | `hr.manager` | retenido | Date of birth (YYYY-MM-DD) |
| `national_id` | text | `confidential_hr` | sí | `hr.manager` | retenido | National identity or social security number |
| `emergency_contact` | text | `confidential_hr` | sí | `hr.manager` | retenido | Name and phone of the person to call in an emergency |
| `salary` | money | `financial` | sí | `hr.manager` | retenido | Gross annual salary (minor currency units, e.g. cents) |
| `bank_iban` | text | `financial` | sí | `hr.manager` | retenido | Bank account salary is paid into |
| `union_member` | bool | `special_category` | sí | `hr.special_reader` | retenido | Whether the person is a trade union member |
| `work_permit_expiry` | date | `special_category` | sí | `hr.special_reader` | retenido | Date the work permit expires, for non-citizens (YYYY-MM-DD) |
| `health_note` | longtext | `special_category` | sí | `hr.special_reader` | retenido | Health condition or disability relevant to the workplace |
| `state` | select (onboarding, active, offboarded) | `none` | no | `hr.user` | en claro | Employment status: onboarding, active, offboarded |

### `hr_leave_request`

A request for time off

Grupo de lectura: `hr.user`. Grupo de escritura: `hr.user`.

| Campo | Tipo | Clase de datos | Datos personales | Grupo | Los agentes ven | Descripción |
|---|---|---|---|---|---|---|
| `employee_id` | ref → hr_employee | `none` | no | `hr.user` | en claro | The employee asking for time off |
| `leave_kind` | select (paid, unpaid, parental, study, other) | `confidential_hr` | sí | `hr.user` | retenido | Kind of leave: paid, unpaid, parental, study, other |
| `start_on` | date | `internal` | sí | `hr.user` | enmascarado | First day of absence (YYYY-MM-DD) |
| `end_on` | date | `internal` | sí | `hr.user` | enmascarado | Last day of absence (YYYY-MM-DD) |
| `days` | number | `none` | no | `hr.user` | en claro | Working days requested |
| `reason` | longtext | `confidential_hr` | sí | `hr.manager` | retenido | Why the leave is requested |
| `is_sick_leave` | bool | `special_category` | sí | `hr.special_reader` | retenido | Whether the absence is due to illness |
| `medical_note` | longtext | `special_category` | sí | `hr.special_reader` | retenido | Reference to the medical certificate, if any |
| `state` | select (draft, requested, approved, refused) | `none` | no | `hr.user` | en claro | Request status: draft, requested, approved, refused |

## Flujos de trabajo

### `hr_employee`

| Acción | Mueve | Quién puede ejecutarla | Aprobación |
|---|---|---|---|
| `hr_employee.activate` | state: onboarding → active | `hr.manager` | no |
| `hr_employee.offboard` | state: active → offboarded | `hr.manager` | sí |

### `hr_leave_request`

| Acción | Mueve | Quién puede ejecutarla | Aprobación |
|---|---|---|---|
| `hr_leave_request.request` | state: draft → requested | `hr.user` | no |
| `hr_leave_request.approve` | state: requested → approved | `hr.manager` | sí |
| `hr_leave_request.refuse` | state: requested → refused | `hr.manager` | sí |

## Grupos de permisos

Grupos que usa esta aplicación:

- `hr.manager`
- `hr.special_reader`
- `hr.user`

## Pasos con aprobación

Pasos que un agente solo puede proponer:

- `hr_employee.offboard`
- `hr_leave_request.approve`
- `hr_leave_request.refuse`

## Qué pueden y qué no pueden hacer los agentes

Un agente puede leer, buscar, crear y actualizar registros de esta aplicación, y ejecutar las acciones que no requieren aprobación, dentro de los grupos de permisos de su token.

Solo puede proponer estos pasos, y una persona debe aprobarlos: `hr_employee.offboard`, `hr_leave_request.approve`, `hr_leave_request.refuse`, `hr_department.delete`, `hr_employee.delete`, `hr_leave_request.delete`.

Los datos personales se enmascaran como tokens marcadores: `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`.

Estos campos se retienen por completo y los agentes no los ven: `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`.

## Dependencias

Ninguna.

## Instalación

Instálala desde la aplicación Customize (Marketplace) o desde la línea de comandos:

```bash
obop modules install-from hr
```

Requiere una base de datos y derechos de administrador.

## Crea la tuya

[La guía de módulos explica cómo se escriben aplicaciones como esta](/es/docs/reference/module-manifest/)
