Session 1 Build Notes — HEMMS Demo Sandbox¶
Date: 2026-05-12 Author: Trinity Roots Co., Ltd.
What Was Built¶
Two custom Odoo 18.0 CE modules for the HEMMS (Hospital Equipment Maintenance Management System) demo sandbox:
1. roots_hemms_criticality (v18.0.1.0.0)¶
2D criticality classification for maintenance equipment. Each equipment record is assigned a Value Tier (Low / Medium / High) and a Risk Tier (Low / Medium / High). A computed Criticality Color (green / yellow / red) is derived from a fixed 3×3 matrix:
| Risk: Low | Risk: Medium | Risk: High | |
|---|---|---|---|
| Value: Low | 🟢 Green | 🟢 Green | 🟡 Yellow |
| Value: Medium | 🟢 Green | 🟡 Yellow | 🔴 Red |
| Value: High | 🟡 Yellow | 🔴 Red | 🔴 Red |
Traffic-light badges are displayed on form, tree, and kanban views. Search filters allow filtering by criticality level, value tier, and risk tier, with group-by options.
2. roots_hemms_workflow (v18.0.1.0.0)¶
5-stage repair workflow replacing Odoo's default maintenance request stages:
| # | Stage | Thai Name | Default Role | SLA Hours |
|---|---|---|---|---|
| 1 | Submitted | ส่งซ่อม | Ward Staff | 4h |
| 2 | Pending Review | รอตรวจสอบ | BME Manager | 8h |
| 3 | In Repair | กำลังซ่อม | BME Technician | 24h |
| 4 | Awaiting Pickup | ซ่อมเสร็จ - รอรับ | BME Manager (Sign-off) | 8h |
| 5 | Received | รับงานแล้ว | Ward Staff | — |
Features: - SLA timers with breach indicators (red flags on kanban + tree, alert banner on form) - Audit trail via hemms.stage.transition.log model (immutable, no-delete security) - Stage transition messages posted via mail.thread - Kanban drag-and-drop between stages - Equipment criticality color integration on request views
Architecture Overview¶
Both modules extend Odoo's core maintenance module via standard model inheritance (_inherit). No core files are modified. The criticality module adds computed fields to maintenance.equipment; the workflow module extends maintenance.stage and maintenance.request, and introduces the new hemms.stage.transition.log model. All custom fields are prefixed with roots_ to avoid namespace collisions. 14 OCA maintenance modules are vendored (unmodified) from the OCA/maintenance 18.0 branch.
Module Dependency Graph¶
maintenance (Odoo core)
├── maintenance_equipment_tags (OCA)
│ └── roots_hemms_criticality
│ └── roots_hemms_workflow
│ ├── hr (Odoo core)
│ └── mail (Odoo core)
└── [12 other OCA modules — independent]
How to Install on a Fresh Sandbox¶
cd hemms-demo
cp .env.example .env # Edit with real passwords
make up-private # or make up-gov
# Wait ~30s for containers to start
# Visit http://localhost:8069 (or :8169)
# Create database via Odoo UI using the master password
make install-private # or make install-gov
Known Issues / Deferred Items¶
- No Docker on build machine — all code was written without live smoke testing. First run may surface XML view inheritance issues that need debugging.
- Placeholder icons — both modules have 1×1 pixel placeholder icons. Need proper Roots-branded icons.
- SLA breached search — uses a Python-side search method that scans all requests. Acceptable for demo scale but won't perform on large datasets.
roots_current_responsible_user_id— currently falls back to the current user if no specific user is assigned. A proper implementation would maproots_responsible_roleon the stage to actual HR department/job positions.- Thai translations —
.pofiles are populated with key strings but need review by a native Thai speaker. - Stage data conflict — the 5 stages are loaded with
noupdate="1", but Odoo's core maintenance module also ships default stages. Users may see both sets; the core stages should be archived manually after install. - Kanban view XPath — inheriting the kanban template relies on
hasclass('oe_kanban_details')which may differ if other OCA modules restructure the kanban card. Priority should be verified on first boot.
What Session 2 Should Build¶
roots_hemms_dashboard— KPI tiles (total equipment by criticality, open requests by stage, SLA breach count), charts (requests over time, MTTR by category), and SLA breach panelroots_hemms_branding_private— Roots logo, Thai language default, menu cleanup for private hospital demoroots_hemms_branding_gov— Same for government hospital demo, with government-appropriate theming