SmartERP Documentation An Ashewa Technology Solutions Platform

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.

Settings and Organizational Configuration

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 IdentifierDatabase TableKey Foreign KeysPurpose & Business Rules
hr.employeehr_employeeFK department_id, FK job_id, FK parent_idCore personnel master records; holds Fayda ID, TIN, and bank accounts.
hr.contracthr_contractFK employee_id, FK grade_id, FK struct_idEmployment contract defining wage, grade level, step, and allowances.
hr.gradehr_gradeSelf-referencing sequence 1–16Ashewa 16-grade Hay structure computing base, steps, and allowance defaults.
hr.paysliphr_payslipFK employee_id, FK contract_id, FK move_idIndividual monthly payslip record with computed gross-to-net rule lines.
hr.payslip.runhr_payslip_runOne2many to hr.payslipMonthly payroll batch container for bulk calculation and GL voucher posting.
hr.salary.rulehr_salary_ruleFK category_id (ALW, DED, COMP)Python calculation rules for Proclamation 1395/2025 tax, pension, and bonuses.
hr.attendancehr_attendanceFK employee_idBiometric check-in/check-out logs computing overtime hours.
hr.leavehr_leaveFK holiday_status_id, FK employee_idLeave 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 GroupTechnical IdentifierFunctional PermissionsSegregation of Duties Restrictions
Employee (ESS)base.group_userView own profile, submit leave requests, download own payslips.Strictly restricted to own employee records via record rules.
HR Officerhr.group_hr_userCreate/edit employee files, manage attendance, record leaves.Cannot view or modify salary rates or contract wages.
HR Managerhr.group_hr_managerFull employee administration, grade setup, contract validation.Cannot post payroll batches to the General Ledger.
Payroll Officerom_hr_payroll.group_hr_payroll_userCalculate payslips, input overtime, generate bank files.Cannot modify salary grade bands or approve own contract.
Payroll Manager / CFOom_hr_payroll.group_hr_payroll_managerConfirm 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 NameTechnical IntervalModel TriggeredOperational Purpose
Biometric Punch IngestionEvery 10 Minuteshr.attendance._cron_sync_biometricsIngests hardware punch logs from network biometric terminals.
Contract Expiration WatcherDaily at 01:00 AMhr.contract._cron_check_expirationsAlerts HR of probationary terms and contract expiries 30 days in advance.
Ge'ez Holiday Occurrence SyncAnnuallysmart.et.holiday._cron_generate_annual_holidaysComputes Bahire Hasab and Hijri movable holidays for the new fiscal year.
Monthly Leave AccrualMonthly on the 1sthr.leave.allocation._cron_accrue_leavesAccrues monthly annual leave allocations for active employees.
Last updated: 2026-10-16