Fix admin search for PurchaseOrderLineItem - #12508
Merged
SchrodingersGat merged 1 commit intoJul 31, 2026
Merged
Conversation
Expand search_fields on PurchaseOrderLineItemAdmin to allow searching by part name, part description, supplier SKU, order reference, and supplier name. Previously, only the optional 'reference' field was searchable, making it impossible to find line items by part or order details. - part__part__name: search by underlying Part name - part__part__description: search by Part description - part__SKU: search by Supplier SKU - order__reference: search by Purchase Order reference - order__supplier__name: search by Supplier name Also adds a unit test to verify the search_fields are correctly configured.
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12508 +/- ##
==========================================
- Coverage 86.72% 86.72% -0.01%
==========================================
Files 1444 1444
Lines 96138 96145 +7
Branches 11208 11208
==========================================
+ Hits 83377 83378 +1
- Misses 12697 12703 +6
Partials 64 64
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
SchrodingersGat
approved these changes
Jul 31, 2026
Member
|
@bhumin18 thanks for the contribution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands
search_fieldsonPurchaseOrderLineItemAdminto allow searching by part name, part description, supplier SKU, order reference, and supplier name.Motivation
Previously only the optional
referencefield was searchable, making it impossible to find line items by part or order details in the Django Admin panel.Searching for a part name like
Widgetreturned 0 results, while the same search onSalesOrderLineItemAdminworks correctly because it haspart__namein itssearch_fields.Changes
src/backend/InvenTree/order/admin.py: Expandedsearch_fieldsonPurchaseOrderLineItemAdminsrc/backend/InvenTree/order/tests.py: Added unit test to verify search_fields configuration