Skip to content

[Feature] Repair orders #12064

Open

Description

@SchrodingersGat

Discussed in #7694

I run a repair service. From what I can see, Inventree is not able to create a repair order, and to track parts and a description of repair work done to a customer's unit. Is this a feature that would be likely implemented?

Concept Requirements

  • Determine scope of feature
  • Required DB models
  • Required UI elements
  • Require API flows

Activity

  1. added this to the horizon milestone on Jun 1, 2026
  2. added
    enhancement
    on Jun 1, 2026
  3. adityakrmishra commented on Jun 2, 2026

    @adityakrmishra
    Contributor

    @SchrodingersGat @matmair I can pick this up. Since this requires core schema additions, I want to sync on the architecture before cutting a PR.

    TL;DR: I'm visualizing this as a hybrid between a SalesOrder (customer-facing) and a BuildOrder (consuming internal stock).
    Proposed DB Models (Django)
    Integrated into the order app (or a new repair app):
    RepairOrder: reference (auto-seq), customer (FK to Company), customer_reference, item_description, symptoms, status (integer choices: Pending, In Progress, Completed, etc.). Inherits from standard Attachment/Notes mixins.
    RepairOrderLineItem & RepairOrderAllocation: To map and consume StockItems used during the repair.

    API Routing
    Standard DRF ModelViewSet CRUD for the models (e.g., /api/order/repair/).
    Custom actions like /api/order/repair//issue/ to execute the permanent stock deduction once parts are installed.

    UI (Mantine)
    New RepairOrderTable index.
    Detail view with panels for: Customer Details/Symptoms, Parts Allocation (similar to BO UI), and Markdown Notes for the tech's repair log.

    Let me know if this scope aligns with what you had in mind. If this architecture LGTM, I'll start scaffolding the backend models and API as a v1

  4. modified the milestones: horizon, 2.0.0 on Jun 3, 2026
  5. matmair commented on Jun 3, 2026

    @matmair
    Member

    there are a few important things missing here: business context on the function, what kind of actions might be required and the lifecycle of orders in this new concept.
    The tech is the easy part that any llm can do

  6. matmair commented on Jun 3, 2026

    @matmair
    Member

    @cameleonnzl @VMT-Solutions @ataylor-rp can you give insights on how you imagine this function / what you intended workflow and possible actions are for handling a order?

  7. ataylor-rp commented on Jun 3, 2026

    @ataylor-rp

    @matmair For my company, we're looking for an easy way to track parts used for a maintenance cycle on our fleet of equipment. I briefly considered creating a new assembly record for each maintenance order and building the BOM as we went through triage and repair, and then issuing a build order after the fact for record keeping, but the shop floor didn't like the number of steps involved. So for us, our ideal case is to be able to open a work order against a specific fixed asset that we're repairing, and allocate parts to a list as we go. I'll put some thought into specific steps and elaborate further later today.

  8. bountyhub-bot commented on Jun 3, 2026

    @bountyhub-bot

    🚀 Bounty Alert!

    💰 A bounty of $15.00 has been created by matmair on BountyHub for this issue.

    🔗 Claim this bounty by submitting a pull request that solves this issue!

    You can also increase the amount of the bounty if you think the issue is worth more.

    Good luck, and happy coding! 💻

  9. adityakrmishra commented on Jun 4, 2026

    @adityakrmishra
    Contributor

    @matmair @ataylor-rp That makes complete sense. I completely agree that the business lifecycle needs to dictate the architecture.

    To keep things moving without stepping on the design process, I have restricted PR #12072 strictly to the baseline backend scaffolding (DB models and API endpoints based on the initial Sales/Build order hybrid concept). The CI is currently green and passing all strict schema checks.

    I also have the baseline Mantine UI built locally, but I will hold off on pushing that into a Phase 2 PR until we nail down this exact workflow.

    @ataylor-rp, linking the Repair Order directly to a specific "fixed asset" (perhaps a specific serialized StockItem?) rather than just a customer makes a lot of sense for fleet maintenance. Looking forward to seeing your elaborated steps so I can adjust the models and UI to match!

  10. ataylor-rp commented on Jun 5, 2026

    @ataylor-rp

    @matmair @adityakrmishra Apologies for the delay.

    We have three types of maintenance tasks we deal with: Regular scheduled maintenance, emergency repairs, and system upgrades. So in general terms we'd like to be able to define task types or categories, similar to the categories used for parts.

    Work flow for us would be something like this:

    Create a work order, with fields for affected item (We use the unit name, but could be a serial number), expected start date, expected completion date, attachments (work instructions, descriptions of damage, change notices, etc.), repair classification (as mentioned above), and priority (high, medium, low, or something similar). (I don't know if @cameleonnzl or @VMT-Solutions are following this thread, but I imagine they'd like to see fields for Customer and Returned Goods Authorization, as well.)

    When the unit comes in, triage the damage and pull parts as needed from inventory, recording them against the work order.

    At completion of maintenance, attach the completed maintenance check list and any test results to the work order.

    Maintenance manager signs off on work order and it's marked complete, consuming the allocated inventory.

    We have some sub-assemblies that we refurbish regularly and track under a separate part number from new units. For those I've created a BOM where all the parts are optional, and the technician can just allocate to a build order what they use as they do the rebuild, but that is a little unwieldy when we get past 10-12parts in a BOM. So the key change we'd be looking for is being able to add line items to a build/work order BOM after the order has been issued.

  11. matmair commented on Jun 5, 2026

    @matmair
    Member

    Just so that anybody reading this is clear: we are still waiting for feedback from users. Wait till there is consensus on the actual data shape and processes before running of implementing stuff on one users singular opinion.

  12. VMT-Solutions commented on Jun 5, 2026

    @VMT-Solutions

    We have very similar workflow as previously mentioned. For us it will be very beneficial to take a Asset , create a work order and allocate any part in the inventory against it as some repairs or maintenance can become complicated. As ive understood this would require asset tracking but we could live with creating it against build order.

    If inventree would go forward with assets it would solve a even bigger obstacle for us and we can totalt move a whole system over to inventree to get a unified database.

    Please let me know what path you would like to pursue.

  13. ICT-CC commented on Jun 8, 2026

    @ICT-CC

    We recently started with InvenTree and find a similar need.

    The assets we get in for service may or may not originate from us.
    Where they originate from us, it would be nice to retain the serial number (not required for us, might be for others).

    Not fully familiar with the code/models yet, initial thought was something similar to a build order:

    • Create a new order for a quantity of a specific part
    • Initial inspection:
      • For assemblies, have the BOM as line items with functionality to set issues (with optional Choices, eg parameters)
      • Add extra lines items (eg sales order) for non-assembly and for issues specific to a BOM line item.
    • Ability to list issues & parts needed before next stage (for pre-approval quotes, order parts)
    • Repair:
      • Add any additional issues found while servicing
      • For assemblies, mark each BOM line item with actions taken (& allocate from stock if needed), or OK/Pass
      • Mark actions taken related to entire part (for assemblies, non-BOM line item issues)
    • List issues & resolutions/actions completed, and allocated parts (->sales order)

    For the time being, we are trying a method of adding two optional tests to each assembly (service inspect & service results), then creating a new build order and typing in notes for those 'tests'.

  14. MBLitom commented on Jun 18, 2026

    @MBLitom

    I had a quick look through the existing order flow and I think the first decision should be whether this feature needs a completely new RepairOrder model, or whether it should extend the existing ReturnOrder flow.

    From what I can see, ReturnOrder already covers a large part of the repair use case:

    • customer relationship
    • optional sales order relationship
    • returned stock item relationship via ReturnOrderLineItem
    • receiving returned items into stock
    • return line outcome states
    • existing ReturnOrderLineStatus.REPAIR
    • pricing on return order line items
    • extra lines
    • API and UI structure for return orders

    Because of that, I would avoid introducing a separate top-level repair order at first unless there is a strong reason to split it from returns / RMA.

    A possible minimal scope could be:

    1. Use ReturnOrderLineItem as the anchor

    When a returned line item has outcome REPAIR, allow the user to create or manage a repair record for that line item.

    This keeps the repair tied to:

    • the customer
    • the returned unit / stock item
    • the original sales order if available
    • the return order lifecycle

    2. Add a repair detail model

    Something like:

    • ReturnOrderRepair
      • return_order_line
      • assigned_to
      • repair_status
      • fault_description
      • diagnosis
      • work_performed
      • started_date
      • completed_date
      • labour_time / labour_cost if required
      • result: repaired / not_repairable / replaced / refunded

    This would describe the actual repair work performed on the customer's unit.

    3. Add consumed parts / materials

    A second model could track parts consumed during repair, for example:

    • ReturnOrderRepairPart
      • repair
      • part or stock_item
      • quantity
      • source_location
      • notes

    The important design question here is how consumed parts should affect stock.

    Possible options:

    • consume parts directly from stock when added to the repair
    • reserve/allocate parts first, then consume on repair completion
    • model the repair as a special internal build/stock operation

    I think this part needs careful alignment with existing stock tracking behaviour rather than inventing a separate stock movement system.

    4. Suggested lifecycle

    A simple repair lifecycle could be:

    • pending inspection
    • diagnosed
    • waiting for parts
    • in repair
    • repaired
    • not repairable
    • returned to customer
    • closed

    This should probably remain separate from the overall ReturnOrder status, because one return order may contain multiple line items with different outcomes.

    5. API flow

    Possible API additions:

    • list/create repair records for a return order line
    • update repair diagnosis / work notes / status
    • add/remove consumed repair parts
    • complete repair
    • mark as not repairable
    • optionally trigger stock consumption on completion

    6. UI elements

    On the existing Return Order detail page, when a line item outcome is REPAIR, show a repair section/tab with:

    • repair status
    • fault / diagnosis / work performed fields
    • consumed parts table
    • labour / cost fields if in scope
    • action buttons: start repair, add part, complete repair, mark not repairable

    7. Open questions

    Before implementation, I think these questions need to be answered:

    • Should repair be limited to returned customer-owned items, or also support internal repairs?
    • Should consumed repair parts be reserved first or consumed immediately?
    • Should repairs generate a sales order / invoiceable line, or only track internal cost?
    • How should serialized parts be handled when used during repair?
    • Should the repaired item return to the same customer automatically?
    • Is warranty handling in scope?
    • Should this be a new top-level order type only if internal repairs are required?

    My preference would be to start with a small extension of the existing ReturnOrder / ReturnOrderLineItem flow, because the existing model already contains much of the customer return / RMA structure. A separate top-level RepairOrder can always be introduced later if the feature grows beyond return-order repair workflows.

  15. mdmccabe9 commented on Jul 1, 2026

    @mdmccabe9

    Hi @matmair @SchrodingersGat @adityakrmishra,
    I'd like to claim the bounty on this issue and take it forward.
    Proposed Approach (v1):
    Extend ReturnOrder / ReturnOrderLineItem (building on the existing scaffolding and #12098 discussion) instead of a full new top-level model. This reuses customer, stock return, and pricing logic.
    Add ReturnOrderRepair model for detailed repair tracking (status, diagnosis, work performed, assigned tech, dates, template support).
    Add lightweight ReturnOrderRepairConsumable for shop supplies (rags, oil, cleaners, etc.) — quick logging without heavy stock allocation every time, while still contributing to costs.
    Bonus: RepairTemplate system (reusable checklists per Part) for standardization and knowledge capture.
    This adds real value for fleet maintenance, RMA repairs, and service workflows while staying aligned with existing patterns.
    I'll start with:
    Models + signals for cost roll-up
    API serializers + endpoints
    Basic Mantine UI panel on Return Order detail
    Happy to adjust based on feedback. Draft PR incoming shortly.
    cc @bountyhub (claiming the $15 bounty)

  16. stevenmini2019 commented on Jul 14, 2026

    @stevenmini2019

    @matmair @SchrodingersGat @mdmccabe9 I have opened PR #12396 — a self-contained backend MVP for Repair Orders, implementing the standalone top-level RepairOrder model approach (echoing the direction in #12326 and #12072).

    • RepairOrder (+ RepairOrderLine) extending Order + OrderLineItem
    • Status codes (Pending / In Progress / On Hold / Complete / Cancelled) and events
    • Status transition endpoints (/issue/, /hold/, /complete/, /cancel/)
    • Full CRUD API, serializers, admin, system settings, migration, and tests
    • This PR intentionally defers frontend + stock consumption to follow-up PRs

    I see the design discussion is ongoing about extending ReturnOrder vs. a new top-level model — happy to refactor if/when consensus is reached. Posting this per the bounty's claim rules.

    cc @bountyhub (claiming the 5 bounty on this issue)

  17. matmair commented on Jul 16, 2026

    @matmair
    Member

    @stevenmini2019 as mentioned previously this has already been assigned, I will but you on my permanent bounty block list.

  18. bamiebot-maker commented on Sep 14, 2026

    @bamiebot-maker

    hi maintainer @matmair is this issue currently available unclosed?

    i have looked at the structure of the project and understood the issue well i am ready to give my quality contribtions

  19. matmair commented on Sep 14, 2026

    @matmair
    Member

    this is being worked on #12072 no new PRs will be accepted

  20. Narasimha1005 commented on Sep 21, 2026

    @Narasimha1005

    Hi all — I'd like to pick this up for the 2.0.0 milestone. Before writing code, here's a concrete scope proposal so we can align on the design and, for those who offered funding in #7694, agree on terms.

    Coordination first: @adityakrmishra — are you actively working on this? @Sajad100k — your requirements questions in #7694 are a great starting point. If either of you is mid-implementation I'm happy to contribute to that instead of duplicating work; otherwise I'm proposing the scope below.

    Proposed scope — Phase 1 (MVP)

    DB models (in order/ or a new repair/ app — maintainer's call):

    • RepairOrder — auto reference, customer (Company), unit (see below), status via the existing state-machine pattern, responsible owner, target/completion dates, notes
    • RepairUnit — a lightweight per-customer unit record (identifier/serial, optional Part reference) so repair history is tracked per device across orders
    • RepairOrderPartLine — Part / StockItem reference, quantity, stock allocation & consumption (reuses existing order-line allocation flows)
    • RepairOrderExtraLine — non-stock charges: labor, diagnostics, shipping

    Status flow: Draft → Received → Diagnosing → Awaiting Parts → In Repair → Ready for Pickup → Completed, with Beyond Repair and Cancelled exits.

    API flows: REST endpoints + serializers + filters consistent with the other customer-facing orders, documented with drf-spectacular; actions to allocate/complete parts against stock; attachments and notes via the generic models.

    UI elements: list page + split-view detail page in the frontend following the ReturnOrder patterns (router registration, Mantine 9 tables/forms, TanStack Query, Lingui i18n), plus a timeline of status changes.

    Explicitly deferred to Phase 2: technician time tracking, customer signatures, customer portal visibility, quoting/invoicing integration.

    Open questions for maintainers

    1. Home for the models — extend order/ vs. a separate repair/ app?
    2. Is a dedicated RepairUnit model the right approach for tracking customer devices, or should this tie into any planned asset-tracking work?
    3. Should a RepairOrder be linkable to a SalesOrder for billing the repair?

    Plan

    Staged PRs per CONTRIBUTING: (1) models + migrations + backend API + tests, (2) frontend pages + Playwright tests, (3) docs. Backend PR first so the API design can be reviewed early. Estimate: backend PR ~2 weeks after sign-off, full feature complete within ~4–6 weeks part-time.

    Funding

    @cameleonnzl @VMT-Solutions @ataylor-rp — you each kindly offered to fund this. To make this sustainable I'd suggest milestone-based funding (e.g. on backend merge and on frontend merge) through whatever transparent mechanism the project prefers (Open Collective, Polar, or another escrowed platform). Happy to finalize amounts and terms here or by email before starting.

    If the maintainers are happy with this scope, I'll start on the backend PR and keep the assignee in the loop throughout.

  21. matmair commented on Sep 21, 2026

    @matmair
    Member

    You can work on this @Narasimha1005 but the funding is spoken for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementfeature

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions