Spare Parts: Get Started¶
This walkthrough configures one piece of equipment for automated spare-part picking on PM and verifies the result. It takes about 10 minutes on a demo instance.
Prerequisites¶
roots_hemms_spare_partsis installedmaintenance_stock(OCA) is installed — provides the Consumption picking type andallow_consumptionsflag- You have at least one equipment record in :menuselection:
Maintenance --> Equipment - You have at least one storable or consumable product in :menuselection:
Inventory --> Products - A PM plan exists for the equipment (see the Preventive Maintenance get-started guide)
Step 1 — Enable consumptions on the equipment¶
- Open :menuselection:
Maintenance --> Equipmentand click an equipment record (e.g., "Vital Signs Monitor #3") - Click the Spare Parts tab (added by this module)
-
Scroll to the Stock & Consumptions section and set:
Field Value Allow Consumptions Enabled Consumption Warehouse The warehouse whose Consumption picking type will be used (e.g., "BME Stores") Auto-create Picking on PM Enabled -
Click :guilabel:
Save
Both toggles must be on
Setting Allow Consumptions without Auto-create Picking on PM means technicians can create pickings manually, but the PM cron will not create them automatically. Set both to get fully automatic drafts.
Consumption warehouse requirement
The selected warehouse must have a Consumption picking type configured (OCA creates one per warehouse automatically when maintenance_stock is installed). If the dropdown is empty, go to :menuselection:Inventory --> Configuration --> Warehouses and verify that the warehouse was set up after maintenance_stock was installed.
Step 2 — Add spare-part template lines¶
Still on the equipment form, in the Spare Parts tab:
- Click :guilabel:
Add a line -
Fill in:
Field Value Notes Product e.g., "ECG Cable (5-lead)" Storable or consumable only Default Qty 2Typical consumption per PM visit PM Kinds "Calibration" Leave blank to include in all PM kinds Position / Note "Lead connector panel" Optional — helps technician locate the part -
Add a second line for a critical spare (e.g., "Lithium Battery CR2032"):
- Product — a product already flagged as a critical spare
- Default Qty —
1 - PM Kinds — leave blank (used in any PM)
- The Critical column automatically shows a red badge because the product has
roots_is_critical_spare = True
-
Click :guilabel:
Save
On Hand column
The On Hand column shows live qty_available. A zero or negative value on a critical line will trigger a daily alert activity (see Workflows → Low-stock activity).
Step 3 — Mark critical spares¶
A spare line is automatically flagged as critical when either condition is true:
- The product has
roots_is_critical_spare = True(set on the product form under the HEMMS tab), or - The equipment's criticality colour is Red (Critical)
No manual toggle exists on the spare line itself — criticality is computed.
To mark a product as a critical spare:
- Open :menuselection:
Inventory --> Products→ click the product - Open the HEMMS tab (or General Information tab — location depends on screen configuration)
- Enable Critical Spare
- Save
All spare lines for that product across all equipment will immediately show the red Critical badge.
Equipment-level criticality shortcut
If you set the equipment to Critical (red) in the Equipment Criticality module, every spare line on that equipment becomes critical automatically — regardless of the product's own flag.
Step 4 — Test: trigger a PM request and verify auto-picking¶
- Open :menuselection:
Settings --> Technical --> Scheduled Actions - Find "Maintenance: generate preventive maintenance requests"
- Click :guilabel:
Run Manually
Now verify:
- Go to :menuselection:
Maintenance --> Maintenance Requests - Find the newly created PM request for your equipment
- Open it and look at the Stock Picking stat button (shows "1 Picking")
-
Click the button — you should see a draft Consumption picking with:
- SR No. — e.g.,
SR/2026/00001 - Move lines matching the spare lines whose
kind_idsmatches the request'smaintenance_kind_id(or all lines if no kind filter)
- SR No. — e.g.,
-
Verify the Pending SR stat button on the request form shows
1
If no picking was created
Check the equipment's Allow Consumptions and Auto-create Picking on PM are both enabled, and that the Consumption Warehouse has a Consumption picking type. Also verify the spare-part template has at least one line.
What just happened¶
When the cron ran:
- OCA
maintenance_plancron created amaintenance.requestwithmaintenance_plan_idset roots_hemms_spare_partscreate()override onmaintenance.requestdetectedmaintenance_plan_id+ both flags enabled_roots_auto_create_spare_picking()filtered the template lines bymaintenance_kind_idand created a draftstock.pickingstock.picking.create()override assigned the nexthemms.stock.requestsequence number asroots_request_no
Next steps¶
- Configuration — Product Thai names, SR sequence, PM kind filtering details
- Workflows — What the technician does with the draft picking
- Reporting — My Open Requests view and equipment stat buttons