Skip to content

ADR 0007: Asset Registry and Component Model — Odoo Implementation

Status

Accepted

Context

ADR 0002 in asset-lifecycle defines the conceptual three-layer architecture:

  1. Conceptual layer: emob-lifecycle-models (domain logic, lifecycle rules)
  2. Implementation layer: ov.asset.registry (Odoo model)
  3. Lineage layer: ov.asset.component (component tracking)

This ADR defines the Odoo-specific model fields, methods, and triggers. The business rationale, lifecycle states, and warranty scoping rules are defined in the conceptual ADR and are not repeated here.

Decision

Implement ov.asset.registry and ov.asset.component as Odoo models in the dirac-odoo repository.

The registry record (called a Build Record at the domain level) is created at MO completion — this is the "true birth" of the asset in the system.

Terminology: ov.asset.registry is the Odoo model (the container / registry). Each row in it represents one Build Record — the assembly-time record for a specific asset. See asset-lifecycle/docs/9-warranty/2-build-record-and-asset-passport.md.

Model Definitions

ov.asset.registry

Central system of record for assembled vehicles.

Field Type Description
oem_id Char Human-readable FG serial, unique
product_template_id M2O product.template Vehicle model
lot_id M2O stock.lot Link to Odoo FG serial lot
mo_id M2O mrp.production Manufacturing order that produced the asset
ckd_lot_id M2O stock.lot Source CKD batch (lot-tracked)
status Selection active, inactive, retired
qr_code Char Encoded lookup reference for verification
tracking_id Char Future trust / cryptographic identifier
warranty_start_date Date Set when asset is sold
warranty_end_date Date Computed from start + warranty period
responsible_party Char Customer or distributor (set at sale)

ov.asset.component

Tracks component-level lineage and replacement history.

Field Type Description
registry_id M2O ov.asset.registry Link to asset registry
component_type Selection chassis, motor, mcu
component_id Char OEM component serial number
state Selection active, replaced, retired
timestamp Datetime Event time
source Selection assembly, service

Triggers

Registry Creation Trigger

At Manufacturing Order (mrp.production) completion:

  1. Read chassis_id, motor_id, mcu_id from the MO or a custom form
  2. Assign / generate oem_id
  3. Create ov.asset.registry record
  4. Create initial ov.asset.component records (state = active)
  5. Transition Odoo stock: FG serial moves to OVT/Finished Goods

Component Replacement Trigger

During service (future ov.service.record model):

  1. Mark old component record as replaced
  2. Insert new component as active
  3. Record timestamp and source = service

Odoo Integration Points

Odoo Model Role
mrp.production Source MO; completion triggers registry creation
stock.lot FG serial tracking (E3-Pro Finished Motorcycle)
stock.lot (CKD) CKD lot tracking (E3-Pro CKD Package)
product.product consu type; E3-Pro CKD Package and E3-Pro Finished Motorcycle
stock.location OVT/CKD Materials, OVT/Assembly, OVT/Test, OVT/Quality, OVT/Packaging, OVT/Finished Goods

Design Rules (Odoo-Specific)

  • ov.asset.registry is the single source of truth for asset identity and lifecycle data
  • Lifecycle logic must not be embedded in Odoo stock models
  • Odoo MRP handles physical production and inventory; the registry handles identity and lifecycle
  • The CKD package is treated as one consumable unit; Odoo BoM is intentionally simplified
  • ov.asset.component preserves history through state transitions, not destructive overwrite

Cross-Reference

  • Conceptual decision: asset-lifecycle/docs/adr/0002-asset-registry-lineage-and-lifecycle-governance.md
  • Domain note: asset-lifecycle/docs/9-warranty/1-assembled-asset-registry-foundation-for-warranty-and-service.md
  • Warranty extension: future ADR (warranty claim workflow, service model)