Skip to content

Feature: Backend scaffolding for Repair Orders (#12064)#12072

Open
adityakrmishra wants to merge 31 commits into
inventree:masterfrom
adityakrmishra:feature-repair-orders-backend-12064
Open

Feature: Backend scaffolding for Repair Orders (#12064)#12072
adityakrmishra wants to merge 31 commits into
inventree:masterfrom
adityakrmishra:feature-repair-orders-backend-12064

Conversation

@adityakrmishra
Copy link
Copy Markdown
Contributor

@adityakrmishra adityakrmishra commented Jun 2, 2026

Addresses the backend requirements for #12064.

This PR introduces the initial Django architecture for the new Repair Order feature, integrating it into the order app as discussed.

Additions:

  • Status Codes: Added RepairOrderStatus enumerations.
  • Models: Added RepairOrder, RepairOrderLineItem, and RepairOrderAllocation to order/models.py.
  • API Routing: Implemented DRF serializers and added CRUD ViewSet endpoints to order/api.py.
  • Linting: Validated via ruff.

(Note: Migration files have not been generated in this commit to avoid environment conflicts. Please run manage.py makemigrations order when reviewing.)

Ready for review before we move on to the Mantine UI scaffolding!

closes #12064

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

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

Name Link
🔨 Latest commit 263a94e
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a2189ec7ac0d7000804a050

@SchrodingersGat
Copy link
Copy Markdown
Member

Code Formatting

As a starting point it looks like your linting is different to our standard.

As per our contributing guide - run this command on your local instance:

invoke dev.setup-dev

This will ensure that any commits will be correctly formatted automatically.

Migration Files

You will need to commit any migration files when changing database models.

Run invoke migrate to generate the necessary migration files, and commit those generated files.

Comment on lines +2516 to +2520
class RepairOrderList(ListCreateAPI):
"""API endpoint for accessing a list of RepairOrder objects."""

queryset = models.RepairOrder.objects.all()
serializer_class = serializers.RepairOrderSerializer
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.

I am missing a permissions class here

@matmair matmair added enhancement This is an suggested enhancement or new feature order Related to purchase orders / sales orders api Relates to the API User Interface Related to the frontend / User Interface labels Jun 3, 2026
@matmair matmair added this to the 2.0.0 milestone Jun 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 96.87500% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.45%. Comparing base (47c6906) to head (d771ebe).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12072   +/-   ##
=======================================
  Coverage   91.44%   91.45%           
=======================================
  Files         976      977    +1     
  Lines       52162    52255   +93     
=======================================
+ Hits        47701    47791   +90     
- Misses       4461     4464    +3     
Flag Coverage Δ
backend 90.46% <96.87%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 91.78% <96.77%> (+0.01%) ⬆️
Backend General 93.38% <100.00%> (ø)
Frontend ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@SchrodingersGat SchrodingersGat left a comment

Choose a reason for hiding this comment

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

A good start!

class RepairOrder(
InvenTree.models.InvenTreeAttachmentMixin,
InvenTree.models.InvenTreeNotesMixin,
InvenTree.models.InvenTreeMetadataModel,
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.

You will need to add a number of other mixin classes here - look at the "BuildOrder" model for reference:

class Build(
    InvenTree.models.PluginValidationMixin,
    report.mixins.InvenTreeReportMixin,
    InvenTree.models.InvenTreeParameterMixin,
    InvenTree.models.InvenTreeAttachmentMixin,
    InvenTree.models.InvenTreeBarcodeMixin,
    InvenTree.models.InvenTreeNotesMixin,
    InvenTree.models.ReferenceIndexingMixin,
    StateTransitionMixin,
    StatusCodeMixin,
    InvenTree.models.MetadataMixin,
    InvenTree.models.InvenTreeTree,
):

@adityakrmishra
Copy link
Copy Markdown
Contributor Author

The backend and frontend features are fully complete and passing all build/database tests. However, my local Windows pre-commit environment seems to be out of sync with the Ubuntu CI runner regarding a final prek formatting rule. Could a maintainer please trigger a format pass or apply the final linting patch on your end?

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

Labels

api Relates to the API enhancement This is an suggested enhancement or new feature order Related to purchase orders / sales orders User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Repair orders

3 participants