Service Contracts: Get Started¶
This walkthrough creates one warranty contract, configures coverage for two maintenance kinds, and verifies that a new corrective request auto-links to it. About 10 minutes on a demo instance.
Prerequisites¶
roots_hemms_service_contractsis installedmaintenance_partner(OCA) is installed — providesassigned_partner_idon equipmentroots_hemms_pmis installed — provides themaintenance.kindvocabulary (Calibration / Safety Inspection / General PM)- You have at least one equipment record in :menuselection:
Maintenance --> Equipment - You have at least one partner you can use as a vendor (any
res.partner; the supplier-rank filter is deferred until thepurchasemodule is added — see Configuration)
Step 1 — Open the Service Contracts menu¶
Navigate to :menuselection:Maintenance --> Service Contracts. You will see four submenus:
- All Contracts — every contract grouped by state
- Active —
state=active - Expiring Soon (≤90d) — active AND
date_end <= today + 90 days - Expired —
state=expired
On a fresh install the lists are empty.
Step 2 — Create your first contract¶
Click :guilabel:New from All Contracts:
| Field | Value |
|---|---|
| Name | MRI 1.5T — GE 5yr MA 2026-2031 |
| Thai Name | สัญญา MA เครื่อง MRI 1.5T |
| Vendor | GE Healthcare (Thailand) Co., Ltd. |
| Contract Type | Maintenance Agreement (MA) |
| Responsible | (defaults to you) |
| SLA Tier | Gold |
| Response Time (hours) | 4.0 |
| Date Start | 2026-01-01 |
| Date End | 2031-01-01 |
| Renewal Alert (days before end) | 60 (the default) |
Open the Equipment tab and add the equipment record you want the contract to cover, e.g. "MRI 1.5T Scanner #1".
Single equipment → partner auto-fills
If the equipment has an assigned_partner_id (set up via OCA maintenance_partner) and you add exactly one equipment to a new contract while Vendor is still blank, the vendor field auto-fills from the equipment.
Click :guilabel:Save. The contract gets a running reference (SC/2026/00001), and its state computes from the dates: active.
Step 3 — Configure coverage by kind¶
Open the contract form and click the Coverage tab. Add one row per maintenance kind that the contract covers:
| Maintenance Kind | Included | Hospital Billable | Notes |
|---|---|---|---|
| Calibration | ✅ | ❌ | quarterly per IEC 60601-2-33 |
| Safety Inspection | ✅ | ❌ | annual electrical safety |
| General Preventive Maintenance | ✅ | ✅ | parts billed at list |
Save. Each line carries two booleans:
- Included — work of this kind is in scope of the contract
- Hospital Billable — even when included, the hospital still pays (e.g. a labor-only contract where parts cost extra)
Kind not in coverage = hospital pays
Any maintenance kind not listed in the Coverage tab is treated as out-of-scope: a request opened with that kind will set roots_is_billable_to_hospital=True and the banner will say "kind not in coverage".
Step 4 — Create a maintenance request and check auto-link¶
Now navigate to :menuselection:Maintenance --> Maintenance Requests and click :guilabel:New:
| Field | Value |
|---|---|
| Subject | Quarterly calibration |
| Equipment | MRI 1.5T Scanner #1 |
| Maintenance Type | Preventive |
| Maintenance Kind | Calibration |
Save. Above the request title, a green banner appears:
✅ Covered by SC/2026/00001 (GE Healthcare) — vendor pays
The :guilabel:Service Contract field next to the maintenance team is auto-filled with SC/2026/00001. The Hospital Billable checkbox is unchecked.
Repeat with a kind that is NOT in coverage (e.g., "Software Update") and watch the banner change to:
⚠ Covered by SC/2026/00001 but kind not in coverage — hospital pays
Step 5 — Verify the renewal alert cron¶
The daily cron HEMMS Service Contract — daily state + renewal alert runs once a day. To test it interactively:
- Edit your test contract: change Date End to today + 30 days while keeping Renewal Alert (days before end) at 60
- Save — the Alert On field recomputes to today − 30 days
- Open :menuselection:
Settings --> Technical --> Automation --> Scheduled Actionsand run the HEMMS Service Contract cron manually - Open the contract form — a "Renewal due: SC/2026/00001" activity is now scheduled on the Responsible user with a deadline equal to
date_end - The contract's Renewal Alerted flag is now True, so re-running the cron does not create a duplicate activity
You now have one working contract with auto-link, billable propagation, and a renewal alert in motion. Proceed to Configuration to set up contract types and SLA tiers for your firm.