Skip to content

Spare Parts

The Spare Parts module (roots_hemms_spare_parts) gives each equipment record its own spare-part template, then uses that template to pre-fill consumption pickings automatically whenever the PM cron fires — eliminating the manual step of looking up which parts a technician needs before they walk to the storeroom.

Key features

1. Spare-part template per equipment

Every equipment record gains a Spare Parts tab listing one hemms.equipment.spare.line per part. Each line stores:

  • Product — storable or consumable item from the product catalogue
  • Default Qty — how many to pull for a typical PM visit
  • PM Kinds — optional filter: include this line only for Calibration, Safety Inspection, or General PM (leave blank to include in all)
  • Position / Note — free-text reminder ("left battery bay", "filter behind front panel")
  • On Hand badge — live qty_available pulled from stock, turning red when the line is critical and stock is zero

2. Auto-draft picking on PM cron

When a PM request is generated by the OCA maintenance cron:

  1. roots_hemms_spare_parts checks whether the equipment has allow_consumptions=True AND roots_auto_generate_picking=True
  2. If yes, it reads the spare-line template, filters lines by the request's maintenance_kind_id, and creates a draft Consumption picking pre-filled with all matching products at their default quantities
  3. The technician only needs to review, adjust, and validate — not build the picking from scratch

3. Stock Request (SR) numbers and tracking

Every picking linked to a maintenance request is assigned a sequential SR number (SR/2026/00001) at creation — from the ir.sequence code hemms.stock.request. A dedicated My Open Requests menu (Maintenance → Operations → Stock Requests) gives technicians and managers a single place to track in-flight SR pickings, with progress bars showing done vs. pending lines.

Architecture

roots_hemms_spare_parts is a Layer 3 (hospital-lens) extension:

Layer Module Role
Layer 1 Odoo maintenance maintenance.equipment, maintenance.request
Layer 1 Odoo stock stock.picking, stock.move
Layer 2 OCA maintenance_stock links pickings to requests, adds allow_consumptions flag and Consumption picking type
Layer 3 roots_hemms_spare_parts spare-line template, auto-picking on PM cron, SR numbers, critical-spare alerts, Thai product names

See Architecture for the full layer model.

What it does NOT do (yet)

  • No reorder point / MRP integration — the module flags low stock via an activity, but it does not auto-create purchase orders. Tracked on the Roadmap.
  • No cost allocation by department — parts consumed are posted to the default stock valuation account. Hospital cost-centre allocation is a Q6+ item.
  • No vendor catalogue per spare — the product's standard vendor is used. Restricting suppliers per equipment type is a future enhancement.

Quick navigation

Page What you'll find
Get Started Enable consumptions, add spare lines, test auto-picking
Configuration Products, equipment settings, SR sequence, PM kind filtering
Workflows End-to-end PM + corrective scenarios, SR numbers, low-stock alerts
Reporting My Open Requests, stat buttons, SR sequence customisation