Skip to content

[WIP] Add repair order support to ReturnOrder model (Phase 1: Backend)#12098

Draft
sanrishi wants to merge 1 commit into
inventree:masterfrom
sanrishi:feature/repair-order
Draft

[WIP] Add repair order support to ReturnOrder model (Phase 1: Backend)#12098
sanrishi wants to merge 1 commit into
inventree:masterfrom
sanrishi:feature/repair-order

Conversation

@sanrishi
Copy link
Copy Markdown

@sanrishi sanrishi commented Jun 5, 2026

Description

This PR adds repair order capabilities to the existing ReturnOrder model, enabling users to track repair work on customer-returned items.

This is Phase 1 — Backend models and API only. Frontend UI components will follow in a separate PR.

Closes #12064

Changes

New fields on \ReturnOrder\

  • \ echnician\ (ForeignKey → User) — who performs the repair
  • \is_repair\ (Boolean) — toggle to mark order as a repair job

New fields on \ReturnOrderLineItem\

  • \symptom\ (TextField) — customer-reported issue

  • epair_description\ (TextField) — description of work performed

New status codes

  • \AWAITING_PARTS\ (27, \Warning) — waiting for parts to arrive
  • \READY_FOR_PICKUP\ (35, \Info) — repaired, ready to return to customer

New model methods

  • \�wait_parts_order()\ — transition to AWAITING_PARTS
  • \mark_ready()\ — transition to READY_FOR_PICKUP

New API endpoints

  • \order/ro//await-parts/\
  • \order/ro//mark-ready/\

Status transition updates

  • \can_hold, \can_issue, _action_complete\ all updated to handle new statuses
  • \READY_FOR_PICKUP\ added to \COMPLETE\ group
  • \AWAITING_PARTS\ added to \OPEN\ group

Files Changed

File Lines
\order/status_codes.py\ +13
\order/models.py\ +72
\order/serializers.py\ +25
\order/api.py\ +22
\order/migrations/0121_return_order_repair_fields.py\ +56

Total: ~190 lines

Future Phases

  • Phase 2: Frontend UI updates — add technician, is_repair, symptom, repair_description fields to forms and detail pages
  • Phase 3: Optional — separate RepairOrder model if warranted

Extends the existing ReturnOrder with repair-specific capabilities:

- Added technician (FK→User) and is_repair (Boolean) fields
- Added symptom and repair_description fields to line items
- Added AWAITING_PARTS and READY_FOR_PICKUP statuses
- Added await-parts and mark-ready API endpoints

Ref: inventree#12064
@sanrishi sanrishi requested a review from SchrodingersGat as a code owner June 5, 2026 20:28
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 5, 2026

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 1b18347
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a233187fbd14800083845f1

@sanrishi
Copy link
Copy Markdown
Author

sanrishi commented Jun 5, 2026

@SchrodingersGat Let me know what i need to address more?

@matmair
Copy link
Copy Markdown
Member

matmair commented Jun 5, 2026

@sanrishi just to make sure you are aware: the bounty for #12064 has been assigned, you will not be eligible to receive it

@sanrishi
Copy link
Copy Markdown
Author

sanrishi commented Jun 5, 2026

@matmair Thanks for clarification! but i am interested to work on this! can i work on this? will solve the issue efficiently!

@sanrishi
Copy link
Copy Markdown
Author

sanrishi commented Jun 5, 2026

@matmair Could you assign me later if aditya not able to complete? i think his pr is staled with unusual changes?

@matmair
Copy link
Copy Markdown
Member

matmair commented Jun 5, 2026

@sanrishi the target requirements are not even clear right now. I don’t know how you or anyone else thinks you will address requirements that have not been fully agreed upon

@matmair
Copy link
Copy Markdown
Member

matmair commented Jun 5, 2026

@sanrishi you are flirting with a org-wide block with this behaviour

@sanrishi
Copy link
Copy Markdown
Author

sanrishi commented Jun 5, 2026

@matmair sorry for that behaviour, but I have a robust implementation approach ready to tackle this, could you assign it to me?

@matmair
Copy link
Copy Markdown
Member

matmair commented Jun 5, 2026

no - see above;
this was strike 2 - strike 3 you get a ban and a name-and-shame

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a full implementation; this does not pass QC checks due to a missing api_version bump amongst other basic things mentioned in the contribution guidelines

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matmair thanks for the review and genuinely sorry for my previous behaviour, I am not going to ask you for assignment, I will complete this pr as you requested changes and then you can decide if I am eligible

Thanks 🙏

@matmair matmair marked this pull request as draft June 5, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Repair orders

2 participants