Repository navigation
Build order consume - #8191
Build order consume#8191
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8191 +/- ##
==========================================
- Coverage 87.14% 87.12% -0.03%
==========================================
Files 1258 1259 +1
Lines 55966 56269 +303
Branches 2078 2072 -6
==========================================
+ Hits 48773 49024 +251
- Misses 6682 6735 +53
+ Partials 511 510 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…nTree into build-order-consume
There was a problem hiding this comment.
Pull Request Overview
This pull request implements the ability to consume stock items against build orders before the build order is completed, allowing for more flexible workflows where stock is consumed at the start while the build may take significant time to finish.
Key changes:
- Adds stock consumption functionality for build orders with new API endpoints and UI components
- Updates part requirements calculation to account for consumed stock quantities
- Enhances build line allocation and consumption tracking with visual progress indicators
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Frontend tests | Updates test timeouts and adds consumption workflow tests |
| BuildLineTable.tsx | Adds consumption functionality, filters, and progress indicators |
| BuildAllocatedStockTable.tsx | Integrates stock consumption actions and forms |
| BuildForms.tsx | Implements new consumption forms for build items and lines |
| API/Backend models | Adds consumed field to BuildLine model and consumption endpoints |
| Documentation | Updates allocation documentation with consumption workflows |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…nTree into build-order-consume
* Adds "consumed" field to BuildLine model * Expose new field to serializer * Add "consumed" column to BuildLineTable * Boolean column tweaks * Increase consumed count when completing allocation * Add comment * Update migration * Add serializer for consuming build items * Improve build-line sub-table * Refactor BuildItem.complete_allocation method - Allow optional quantity to be specified - Adjust the allocated quantity when consuming * Perform consumption * Add "BuildConsume" API endpoint * Implement frontend form * Fixes for serializer * Enhance front-end form * Fix rendering of BuildLineTable * Further improve rendering * Bump API version * Update API description * Add option to consume by specifying a list of BuildLine objects * Add form to consume stock via BuildLine reference * Fix api_version * Fix backup colors * Fix typo * Fix migrations * Fix build forms * Forms fixes * Fix formatting * Fixes for BuildLineTable * Account for consumed stock in requirements calculation * Reduce API requirements for BuildLineTable * Docs updates * Updated playwright testing * Update src/frontend/src/forms/BuildForms.tsx Co-authored-by: Copilot <[email protected]> * Update src/frontend/src/tables/build/BuildLineTable.tsx Co-authored-by: Copilot <[email protected]> * Add unit test for filters * Add functional tests * Tweak query count * Increase max query time for testing * adjust unit test again * Prevent consumption of "tracked" items * Adjust playwright tests * Fix table * Fix rendering --------- Co-authored-by: Copilot <[email protected]>

This is a large(ish) feature branch which allows stock to be consumed by a build order before the build order is complete.
This allows more complex (and useful) workflows, where the build might take some significant time, but the stock is consumed at the start. e.g. a batch of PCBs are loaded, but then require a lot of testing, etc.
Currently, the allocated stock must "languish" in the build order, and this makes tracking of real stock quantities difficult.
Given that this feature might take a while to integrate and test, I am targetting it (for now at least) against 1.0.0. This will not be implemented in the legacy user interface.
Tasks