HR technical architecture
Complete data model specifications, entity relationship diagrams, salary rule execution pipelines, access security groups, and automated crons.
This document provides the technical reference for SmartERP Human Resources and Ethiopian Payroll.

Entity Relationship Schema & Core Models#
SmartERP HR integrates personnel master data, compensation structures, salary rules, attendance logs, and accounting journals:
+----------------------------------------------------------------------------------------------------+
| SMARTERP HR & PAYROLL DATA SCHEMA |
+----------------------------------------------------------------------------------------------------+
| |
| +-----------------------------+ +------------------------------+ |
| | hr.employee |1 * | hr.contract | |
| |-----------------------------|----------------->|------------------------------| |
| | id | | id | |
| | name | | name | |
| | identification_id (Fayda) | | employee_id (FK hr.employee) | |
| | tin_number | | grade_id (FK hr.grade) | |
| | pension_number | | salary_step (step_1 - step_4)| |
| | department_id | | wage (Basic Salary) | |
| | job_id | | hra (Housing Allowance) | |
| | parent_id | | travel_allowance (Transport) | |
| | bank_account_id | | representation_allowance | |
| +-----------------------------+ | communication_allowance | |
| | 1 | state (draft/open/close) | |
| | +------------------------------+ |
| | | 1 |
| v * v * |
| +-----------------------------+ +------------------------------+ |
| | hr.attendance | | hr.payslip | |
| |-----------------------------| |------------------------------| |
| | id | | id | |
| | employee_id (FK hr.employee)| | number (SLIP/YYYY/MM/XXXX) | |
| | check_in (UTC Datetime) | | employee_id | |
| | check_out (UTC Datetime) | | contract_id | |
| | worked_hours | | payslip_run_id (FK run) | |
| +-----------------------------+ | date_from, date_to | |
| | line_ids (hr.payslip.line) | |
| +-----------------------------+ | move_id (FK account.move) | |
| | hr.grade |1 +------------------------------+ |
| |-----------------------------| | * |
| | id | | |
| | sequence (1 - 16) | v 1 |
| | career_level | +------------------------------+ |
| | band_base | | hr.salary.rule | |
| | coefficient | |------------------------------| |
| | range_spread_pct | | id | |
| | step_1, step_2, step_3, | | code (e.g. ET_INCOME_TAX) | |
| | step_4 (Computed Steps) | | category_id (ALW, DED, COMP) | |
| | housing_allowance_amt | | sequence | |
| | representation_allowance_amt| | amount_select | |
| +-----------------------------+ | amount_python_compute | |
| +------------------------------+ |
+----------------------------------------------------------------------------------------------------+
Model Data Dictionary#
| Model Identifier | Database Table | Key Foreign Keys | Purpose & Business Rules |
|---|---|---|---|
hr.employee | hr_employee | FK department_id, FK job_id, FK parent_id | Core personnel master records; holds Fayda ID, TIN, and bank accounts. |
hr.contract | hr_contract | FK employee_id, FK grade_id, FK struct_id | Employment contract defining wage, grade level, step, and allowances. |
hr.grade | hr_grade | Self-referencing sequence 1–16 | Ashewa 16-grade Hay structure computing base, steps, and allowance defaults. |
hr.payslip | hr_payslip | FK employee_id, FK contract_id, FK move_id | Individual monthly payslip record with computed gross-to-net rule lines. |
hr.payslip.run | hr_payslip_run | One2many to hr.payslip | Monthly payroll batch container for bulk calculation and GL voucher posting. |
hr.salary.rule | hr_salary_rule | FK category_id (ALW, DED, COMP) | Python calculation rules for Proclamation 1395/2025 tax, pension, and bonuses. |
hr.attendance | hr_attendance | FK employee_id | Biometric check-in/check-out logs computing overtime hours. |
hr.leave | hr_leave | FK holiday_status_id, FK employee_id | Leave requests synchronized with 13-month Ge'ez calendar engine. |
Salary Rule Execution Pipeline (hr_salary_rule_et.xml)#
When compute_sheet() executes, salary rules process in strict sequence order:
[Sequence 10]: TRANSPORT_ALW ---> Reads contract.travel_allowance
[Sequence 12]: HOUSING_ALW ---> Reads contract.hra
[Sequence 14]: REP_ALW ---> Reads contract.representation_allowance
[Sequence 16]: COMM_ALW ---> Reads contract.communication_allowance
[Sequence 20]: ET_PENSION_EE ---> -round(contract.wage * 0.07, 2)
[Sequence 21]: BON_PERF ---> Input Performance Bonus
[Sequence 22]: BON_PROJ ---> Input Project Delivery Bonus
[Sequence 23]: BON_INNOV ---> Input Innovation Bonus
[Sequence 24]: BON_SPOT ---> Input Spot Bonus
[Sequence 30]: ET_INCOME_TAX ---> Progressive Proclamation 1395/2025 Scale
[Sequence 250]: ET_PENSION_ER ---> round(contract.wage * 0.11, 2) (Company Cost)
Safe Execution Guard#
All rule expressions guard against missing bonus inputs using type checks compatible with Odoo's safe_eval:
result = 0.0 if isinstance(inputs.BON_PERF, float) else inputs.BON_PERF.amount
Security Access Groups and Segregation of Duties#
SmartERP enforces strict role-based access control across personnel and payroll data:
| Security Group | Technical Identifier | Functional Permissions | Segregation of Duties Restrictions |
|---|---|---|---|
| Employee (ESS) | base.group_user | View own profile, submit leave requests, download own payslips. | Strictly restricted to own employee records via record rules. |
| HR Officer | hr.group_hr_user | Create/edit employee files, manage attendance, record leaves. | Cannot view or modify salary rates or contract wages. |
| HR Manager | hr.group_hr_manager | Full employee administration, grade setup, contract validation. | Cannot post payroll batches to the General Ledger. |
| Payroll Officer | om_hr_payroll.group_hr_payroll_user | Calculate payslips, input overtime, generate bank files. | Cannot modify salary grade bands or approve own contract. |
| Payroll Manager / CFO | om_hr_payroll.group_hr_payroll_manager | Confirm payslip batches, post GL vouchers, approve bonuses. | Maker-checker separation: Cannot independently compute and post batches. |
Automated Crons and Scheduled Actions#
SmartERP operates background scheduled actions to automate HR workflows:
| Cron Job Name | Technical Interval | Model Triggered | Operational Purpose |
|---|---|---|---|
| Biometric Punch Ingestion | Every 10 Minutes | hr.attendance._cron_sync_biometrics | Ingests hardware punch logs from network biometric terminals. |
| Contract Expiration Watcher | Daily at 01:00 AM | hr.contract._cron_check_expirations | Alerts HR of probationary terms and contract expiries 30 days in advance. |
| Ge'ez Holiday Occurrence Sync | Annually | smart.et.holiday._cron_generate_annual_holidays | Computes Bahire Hasab and Hijri movable holidays for the new fiscal year. |
| Monthly Leave Accrual | Monthly on the 1st | hr.leave.allocation._cron_accrue_leaves | Accrues monthly annual leave allocations for active employees. |
Last updated: 2026-10-16