--- title: Build Allocation --- ## Build Allocation Allocating stock items to a build order signals an intent that those stock items will be removed from the InvenTree database once the build order is completed. Depending on the particular requirements of the build, and your stock control setup, allocating stock items to a build can be a complex task. In this regard, InvenTree provides an allocation interface which attempts to keep the number of user interactions required to a minimum. !!! warning "Build Completion" Marking a build as *complete* will remove allocated items from stock. This operation cannot be reversed, so take care! ### Untracked vs Tracked Stock Before continuing, it is important that the difference between *untracked* and *tracked* parts, as they impose different requirements when it comes to stock allocation. #### Untracked Stock *Untracked* stock items disappear from the database once they are "used". Once stock items for these parts are removed from the InvenTree database (e.g. used to create an assembly), the tracking information for these stock items disappears. The stock items no longer persist in the database. !!! info "Example: Untracked Parts" You require 15 x 47K resistors to make a batch of PCBs. You have a reel of 1,000 resistors which you allocate to the build. At completion of the build, the stock quantity is reduced to 985 #### Tracked Stock *Tracked* stock items, on the other hand, require special attention. These are parts which we wish to track indefinitely, even if they are "consumed" to create an assembly. *Tracked* stock items are not deleted as they are consumed. Instead, they are installed *within* the assembled unit !!! info "Example: Tracked Parts" The assembled PCB (in the example above) is a *trackable* part, and is given a serial number #001. The PCB is then used to make a larger assembly in a subsequent build order. At the completion of that build order, the tracked PCB is *installed* in the assembly, rather than being deleted from stock. #### BOM Considerations A [Bill of Materials](../bom) to generate an assembly may consist of a mixture of *untracked* and *tracked* components. The build order process can facilitate this, as documentated in the sections below. ### Tracked Build Outputs If a Build Order is created for an assembled part which is itself designed as *trackable*, some extra restrictions apply: - Build outputs must be single quantity - Build outputs must be serialized as they are created ## Allocating Untracked Stock Untracked stock items are allocated against the *Build Order* itself. We do not need to track which *Build Output* these items will be installed into, and so the allocation process can be simplified. Navigate to the *Allocate Stock* tab to view the stock allocation table: {% with id="build_allocate_detail", url="build/build_allocate_detail.png", description="Allocate stock" %} {% include "img.html" %} {% endwith %} In this example, there are two BOM line items which have been partially allocated to the build. Each line has a progress bar indicating how much of the required stock has been allocated. In each row, pressing the icon expands the row, showing a list of stock items which have been allocated against this build. !!! info "Multiple Allocations" Note that multiple stock items can be allocated to the given BOM line, if a single stock item does not have sufficient stock {% with id="build_allocation_expand", url="build/build_allocation_expand.png", description="Allocate expand" %} {% include "img.html" %} {% endwith %} ### Auto Allocation To speed up the allocation process, the *Auto Allocate* button can be used to allocate untracked stock items to the build. Automatic allocation of stock items does not work in every situation, as a number of criteria must be met. For each line in the BOM, stock will be automatically allocated if one (and only one) stock item (for the referenced part) is found (within the specified *source location* for the build): !!! warning "Multiple Stock Items" If multiple stock items are available, the InvenTree auto allocation system cannot make a determination about which stock item to allocate. Selecting *Auto Allocate* opens a dialog window which displays the stock items which will be allocated to the build during the auto allocation process: {% with id="build_auto", url="build/build_auto_allocate.png", description="Auto allocate" %} {% include "img.html" %} {% endwith %} !!! info "Note" Note here that the *SAM-M8Q-0-10* part can be automatically allocated as it only exists in a single stock location. However the other BOM line item exists in multiple locations, and thus cannot be automatically allocated ### Manual Allocation Stock can be manually allocated to the build as required, using the *Allocate stock* button available in each row of the allocation table ### Edit Allocations Stock allocations can be manually adjusted or deleted using the action buttons available in each row of the allocation table. ### Unallocate Stock The *Unallocate Stock* button can be used to remove all allocations of untracked stock items against the build order. ## Allocating Tracked Stock Allocation of tracked stock items is slightly more complex. Instead of being allocated against the *Build Order*, tracked stock items must be allocated against an individual *Build Output*. Allocating tracked stock items to particular build outputs is performed in the *Build Outputs* tab: Let us consider the case where the BOM for the assembled part has a single *trackable* part, which we will call simply "Tracked Part". In the *Build Outputs* tab, we can see that each build output has a stock allocation requirement which must be met before that build output can be completed: {% with id="build_allocate_tracked_parts", url="build/build_allocate_tracked_parts.png", description="Allocate tracked parts" %} {% include "img.html" %} {% endwith %} Here we can see that the incomplete build outputs (serial numbers 5 and 6) now have a progress bar indicating the status of tracked stock item allocation: - Serial number 5 has been fully allocated, and can be completed - Serial number 6 has not been fully allocated, and cannot yet be completed ## Completing a Build Output An individual build output is completed by selecting the "Complete build output" button associated with that build output: {% with id="build_output_complete", url="build/build_output_complete.png", description="Complete build output" %} {% include "img.html" %} {% endwith %} Here the user can select the destination location for the build output, as well as the stock item status. ### Allocated Stock *Tracked* stock items which are allocated against the selected build output will be removed from stock, and installed "inside" the output assembly. The allocated stock items will still exist in the InvenTree database, however will no longer be available for regular stock actions. !!! 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 ## Completing a Build !!! warning "Complete Build Outputs" A build order cannot be completed if there are outstanding build outputs. Ensure that all build outputs are completed first. Once all build outputs have been completed, the build order itself can be completed by selecting the *Complete Build* button: {% with id="build_complete", url="build/complete_build.png", description="Complete build order" %} {% include "img.html" %} {% endwith %} ### Allocated Stock All *untracked* stock items which are allocated against this build will be removed from stock.