-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Patch Sales Order line items progress bar to count fully allocated line items #11102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
CodSpeed Performance ReportMerging this PR will degrade performance by 11.63%Comparing
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | test_search_performance[salesorder] |
30.7 ms | 34.3 ms | -10.36% |
| ❌ | WallTime | test_api_list_performance[/api/order/so/] |
41.3 ms | 46.7 ms | -11.63% |
Footnotes
-
29 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11102 +/- ##
==========================================
- Coverage 88.11% 88.10% -0.01%
==========================================
Files 1290 1290
Lines 58235 58237 +2
Branches 1969 1969
==========================================
+ Hits 51311 51312 +1
- Misses 6433 6434 +1
Partials 491 491
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@SchrodingersGat this changes behavior; how should we document that? |
"Correct" here is a matter of opinion - I would consider a line item only fully complete once it has been shipped to the customer. Perhaps a different solution would be to annotate the queryset with an additional "allocated_lines" attribute, which could be used as an additional, separate column in the frontend table. So, the columns would be:
|
|
Thank you for the insight @SchrodingersGat I fully understand and agree with you. It seems my personal workflow is divergent from the intended workflow, which is why I suggested the "fix", but I now see that it would cause breaking changes for the intended workflow. That said, for users who typically have a low number (1-2) of "Line Items" and "Shipments" per sales order, the two columns show essentially the same information, causing redundancy. I thus still think it would be worthwhile adding the "Allocated Lines" column. I would be happy to try and implement the addition of the new attribute "allocated_lines". |
93b851b to
6756ae1
Compare
|
Thanks for making the change to the API annotation. However you have also added another display panel to the sales order page? It appers to be a duplicate of the existing "line items" panel? |

Fixes #10945
This PR fixes an issue where the "Line Items" progress bar in the Sales Order list view would only increment when items were Shipped. It now correctly increments when a line item is fully allocated.
Implementation Details
Modified
SalesOrderSerializer.annotate_querysetinInvenTree/order/serializers.py.The previous implementation only counted lines where
shipped >= quantity. The new implementation usesSubqueryCountwith an updated filter that counts a line as "complete" if either of the following is true: