Skip to content

Get Started

This is the 5-minute Quick Start for a BME engineer producing the first HA Annual PM Report. It assumes:

  • The module is installed.
  • Q1 (roots_hemms_pm) PM data exists for the fiscal year you want to report on.
  • At least some equipment in the target department has a risk classification — either a MoPH device class linked, an EM-score filled, or an explicit override.

If equipment classification is incomplete, head to Configuration first.

Step 1 — Open the wizard

Navigate to Maintenance → Reporting → Generate HA Annual PM Report.

The wizard opens in a modal.

Step 2 — Pick fiscal year + department

The wizard pre-fills the current Thai fiscal year (ปีงบประมาณ พ.ศ.). Pick the year you're reporting on (typically the year that just ended) and the department.

You'll see two live preview values populate:

  • Period: the date range of the fiscal year (1 Oct → 30 Sep).
  • Equipment to include: the count of in-scope active equipment in that department with a positive PM frequency (i.e. on the PM register).

If the count is 0, you have no classified equipment in that dept — head to Configuration to either link MoPH device classes or fill the EM-score sliders.

If a report already exists for that (dept, year), the wizard warns and refuses to create a duplicate. Click the existing report's link to open it directly.

Step 3 — Generate

Click Generate.

The wizard creates a new hemms.ha.report in In Progress state and lands you on the report form. Behind the scenes:

  • One hemms.ha.report.line per piece of in-scope equipment.
  • pm_planned_count derived from 12 // pm_freq_months per line.
  • pm_actual_count derived from closed preventive maintenance.request for that equipment inside the fiscal-year window.
  • result='pass' pre-seeded for lines at 100% compliance (lines below plan are left blank for your review).
  • responsible_id defaulted from each equipment's technician or assigned employee.

Step 4 — Review lines + fill exceptions

Open the Equipment Lines tab. Scan the list — colour cues:

  • 🟢 green row — result already set to pass (compliance met).
  • ⚪️ blank — needs review.

For any line below plan, set the result to conditional / fail / not_done and fill the exception reason column. The system refuses to submit without an exception reason on fail/not_done lines.

The Exceptions tab gives you a filtered view of the same lines — useful when you have lots of equipment and only a handful of exceptions.

Step 5 — Pick signers

Open the Signers tab. Fill three slots:

  • BME Head — head of the BME / engineering department.
  • Engineering Head — broader engineering manager (often the hospital's chief technical officer).
  • Hospital Director — final approver.

Each must be a res.users with a linked res.partner. If any slot is missing or partner-less, Send for Signature will refuse with a clear error message — fix and retry.

Step 6 — Submit

Click ส่งรายงาน (Submit) in the header. The system:

  1. Builds the immutable JSON snapshot (freezes lines + MoPH table for surveyor reprint stability).
  2. Transitions state In Progress → Submitted.
  3. Posts a chatter message documenting the freeze.

After submit, lines are read-only. Any attempt to edit raises UserError and points you at the Reset to Draft path (manager only).

Step 7 — Send for signature

Click 📝 Send for Signature in the header (visible only on submitted, not-yet-signed reports).

The system:

  1. Renders the QWeb PDF.
  2. Creates a sign.oca.request with three signers correctly mapped to the role seeds.
  3. Opens the request form.

From here, internal signers click the pencil icon in their systray to sign. Portal signers (e.g. an off-site director) receive an email with a signing link.

Step 8 — Watch for completion

When all three signers complete, the system automatically:

  • Writes the signed PDF to roots_signed_pdf on the report.
  • Posts it to chatter as an attachment.
  • Flips the header badge from 🟡 รอลงนาม to 🟢 ลงนามครบ.

The report stays in Submitted state — signing is a parallel facet (badge), not a state transition.

Step 9 — Print

At any point, the report can be printed via the standard Print menu. Submitted reports render from the snapshot — surveyor reprints next year will be byte-identical to today's.

Total time

For a department of 30 equipment with most classified against the MoPH table: about 5 minutes of engineer time, of which 4 minutes is reviewing exceptions and filling reasons. Compared to 2–4 weeks of spreadsheet reconciliation, the savings compound across departments.

Next steps

  • Configuration — set up MoPH device classes and EM scores
  • Workflows — full lifecycle + rejection handling
  • Reporting — PDF anatomy + reprint guarantees