mirror of
https://github.com/inventree/InvenTree.git
synced 2025-09-13 14:11:37 +00:00
Build order consume (#8191)
* 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 <175728472+Copilot@users.noreply.github.com> * Update src/frontend/src/tables/build/BuildLineTable.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 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 <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
BIN
docs/docs/assets/images/build/parts_allocated_consumed.png
Normal file
BIN
docs/docs/assets/images/build/parts_allocated_consumed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
@@ -126,6 +126,49 @@ Here we can see that the incomplete build outputs (serial numbers 15 and 14) now
|
||||
!!! note "Example: Tracked Stock"
|
||||
Let's say we have 5 units of "Tracked Part" in stock - with 1 unit allocated to the build output. Once we complete the build output, there will be 4 units of "Tracked Part" in stock, with 1 unit being marked as "installed" within the assembled part
|
||||
|
||||
## Consuming Stock
|
||||
|
||||
Allocating stock items to a build order does not immediately remove them from stock. Instead, the stock items are marked as "allocated" against the build order, and are only removed from stock when they are "consumed" by the build order.
|
||||
|
||||
In the *Required Parts* tab, you can see the *consumed* vs *allocated* state of each line item in the BOM:
|
||||
|
||||
{{ image("build/parts_allocated_consumed.png", "Partially allocated and consumed") }}
|
||||
|
||||
Consuming items against the build order can be performed in two ways:
|
||||
|
||||
- Manually, by consuming selected stock allocations against the build order
|
||||
- Automatically, by completing the build order
|
||||
|
||||
### Manual Consumption
|
||||
|
||||
Manual consuming stock items (before the build order is completed) can be performed at any point after stock has been allocated against the build order. Manual stock consumption may be desired in some situations, for example if the build order is being performed in stages, or to ensure that stock levels are kept up to date.
|
||||
|
||||
Manual consumption of stock items can be performed in the in the following ways:
|
||||
|
||||
#### Required Parts Tab
|
||||
|
||||
Consuming stock items can be performed against BOM line items in the *Required Parts* tab, either against a single line or multiple selected lines:
|
||||
|
||||
- Navigate to the *Required Parts* tab
|
||||
- Select the individual line items which you wish to consume
|
||||
- Click the *Consume Stock* button
|
||||
|
||||
#### Allocated Stock Tab
|
||||
|
||||
Consuming stock items can also be performed against the *Allocated Stock* tab, either against a single allocation or multiple allocations:
|
||||
|
||||
- Navigate to the *Allocated Stock* tab
|
||||
- Select the individual stock allocations which you wish to consume
|
||||
- Click the *Consume Stock* button
|
||||
|
||||
### Automatic Consumption
|
||||
|
||||
When a build order is completed, all remaining allocated stock items are automatically consumed by the build order.
|
||||
|
||||
### Returning Items to Stock
|
||||
|
||||
Consumed items may be manually returned into stock if required. This can be performed in the *Consumed Stock* tab.
|
||||
|
||||
## Completing a Build
|
||||
|
||||
!!! warning "Complete Build Outputs"
|
||||
|
Reference in New Issue
Block a user