2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-17 09:48:30 +00:00

[plugin] Auto issue orders (#9565)

* Add builtin plugin for auto-issuing orders

* Add plugin to auto-issue orders

* Add placeholder documentation

* Fix typo

* Adds image macro

- To replace img.html
- includes checking if file exists

* Fix tooltips

* More docs

* Adjust plugin settings filters

* docs

* More docs

* More docs

* Updates

* Less restrictive URL checking

* Refactor build order page

* Fix typo

* Allow 429

* Debug output

* More debug

* Construct assets dir

* Cleanup

* Update docs README

* Refactoring more pages

* Fix image link

* Fix SSO settings

* Add hook to check for missing settings

- Ensure that all settings are documented!

* Add missing user settings

* Update docstring

* Tweak SSO.md

* Image updates

* More updates

* Tweaks

* Exclude orders without a target_date

* Fix for issuing build orders

* Further refactoring

* Fixes

* Image refactoring

* More refactoring

* More refactoring

* Refactor app images

* Fix pathing issues

* Suppress some openapidocs warnings in logs

(much easier to debug docs build issues)

* Fix image reference

* Reduce error messages

* Fix image links

* Fix image links

* Reduce docs log output

* Ensure settings are loaded before displaying them

* Fix for UI test

* Fix unit test

* Test tweaks
This commit is contained in:
Oliver
2025-06-03 17:07:12 +10:00
committed by GitHub
parent 89f8f132e1
commit 11ab0203b1
124 changed files with 1178 additions and 957 deletions

View File

@@ -46,9 +46,7 @@ Untracked stock items are allocated against the *Build Order* itself. We do not
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 %}
{{ image("build/build_allocate_detail.png", "Allocate stock") }}
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.
@@ -57,19 +55,13 @@ Clicking on a particular row expands the row, showing a list of stock items whic
!!! 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 %}
## Manual Stock Allocation
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):
Selecting *Allocate Stock* 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 %}
{{ image("build/build_auto_allocate.png", "Auto allocate") }}
Note here that there are two parts in the BOM which can be automatically allocated, as they only have a single corresponding StockItem available.
However the other BOM line item exists in multiple locations, and thus cannot be automatically allocated. These will need to be manually selected by the user.
@@ -92,9 +84,7 @@ To speed up the allocation process, the *Auto Allocate* button can be used to al
The *Automatic Allocation* dialog is presented as shown below:
{% with id="auto_allocate_dialog", url="build/auto_allocate_dialog.png", description="Automatic allocation dialog" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/auto_allocate_dialog.png", "Automatic allocation dialog") }}
**Source Location**
@@ -122,9 +112,7 @@ Allocating tracked stock items to particular build outputs is performed in the *
In the *Pending Items* 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 %}
{{ image("build/build_allocate_tracked_parts.png", "Allocate tracked parts") }}
Here we can see that the incomplete build outputs (serial numbers 15 and 14) now have a progress bar indicating the status of tracked stock item allocation:
@@ -145,9 +133,7 @@ Here we can see that the incomplete build outputs (serial numbers 15 and 14) now
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 %}
{{ image("build/build_complete.png", "Complete build") }}
### Allocated Stock

View File

@@ -8,9 +8,7 @@ A Bill of Materials (BOM) defines the list of component parts required to make a
A part which can be built from other sub components is called an *Assembly*.
{% with id="bom_flat", url="build/bom_flat.png", description="Flat BOM Table" %}
{% include 'img.html' %}
{% endwith %}
{{ image("build/bom_flat.png", "Flat BOM Table") }}
## BOM Line Items
@@ -33,9 +31,7 @@ If a BOM line item is marked as *consumable*, this means that while the part and
In the example below, see that the *Wood Screw* line item is marked as consumable. It is clear that 12 screws are required for each assembled *Table*, but the screws will not be tracked through the build process, as this line item is marked as *consumable*
{% with id="bom_item_consumable", url="build/bom_consumable_item.png", description="Consumable BOM Item" %}
{% include 'img.html' %}
{% endwith %}
{{ image("build/bom_consumable_item.png", "Consumable BOM Item") }}
Further, in the [Build Order](./build.md) stock allocation table, we see that this line item cannot be allocated, as it is *consumable*.
@@ -56,9 +52,7 @@ This is particularly useful if a template part is defined with the "common" BOM
Consider the example diagram below:
{% with id="inherited_bom", url="build/inherited_bom.png", description="Inherited BOM Line Items" %}
{% include 'img.html' %}
{% endwith %}
{{ image("build/inherited_bom.png", "Inherited BOM Line Items") }}
**Template Part A** has two BOM line items defined: *A1* and *A2*.
@@ -99,9 +93,8 @@ BOMs can be created manually, by adjusting individual line items, or by upload a
To manually add a BOM item, navigate to the part/assembly detail page then click on the "BOM" tab. On top of the tab view, click on the {{ icon("edit", color="blue", title="Edit") }} icon then, after the page reloads, click on the {{ icon("plus-circle") }} icon.
The `Create BOM Item` form will be displayed:
{% with id="bom_add_item", url="build/bom_add_item.png", description="Create BOM Item Form" %}
{% include 'img.html' %}
{% endwith %}
{{ image("build/bom_add_item.png", "Create BOM Item Form") }}
Fill-out the `Quantity` (required), `Reference`, `Overage` and `Note` (optional) fields then click on <span class="badge inventree confirm">Submit</span> to add the BOM item to this part's BOM.
@@ -110,9 +103,8 @@ Fill-out the `Quantity` (required), `Reference`, `Overage` and `Note` (optional)
To manually add a substitute for a BOM item, click on the {{ icon("transfer") }} icon in the *Actions* columns.
The `Edit BOM Item Substitutes` form will be displayed:
{% with id="bom_substitute_item", url="build/bom_substitute_item.png", description="Edit BOM Item Substitutes" %}
{% include 'img.html' %}
{% endwith %}
{{ image("build/bom_substitute_item.png", "Edit BOM Item Substitutes") }}
Select a part in the list and click on "Add Substitute" button to confirm.

View File

@@ -16,9 +16,7 @@ To navigate to the Build Order display, select *Manufacturing* from the main nav
The *Build Order Index Page* allows the user to view all build orders:
{% with id="build_display", url="build/build_display.png", description="Display Builds" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_display.png", title="Build Orders") }}
The following view modes are available:
@@ -26,17 +24,13 @@ The following view modes are available:
*Table View* provides a table of Build Orders, which can be filtered to only show the orders you are interested in.
{% with id="build_list", url="build/build_list.png", description="Build List" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_list.png", title="Build List") }}
#### Calendar View
*Calendar View* shows a calendar display with outstanding build orders, based on the various dates specified for each order.
{% with id="build_calendar", url="build/build_calendar.png", description="Build Calendar" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_calendar.png", title="Build Calendar") }}
The build calendar allows the user to navigate month-by-month and display the filtered build orders
@@ -121,17 +115,13 @@ The detail view for a single build order provides multiple display panels, as fo
The *Build Details* panel provides an overview of the Build Order:
{% with id="build_details", url="build/build_panel_details.png", description="Build details panel" %}
{% include "img.html" %}
{% endwith %}
{{ image ("build/build_panel_details.png", title="Build Details") }}
### Line Items
The *Line Items* panel displays all the line items (as defined by the [bill of materials](./bom.md)) required to complete the build order.
{% with id="build_allocate", url="build/build_panel_line_items.png", description="Build line items panel" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_panel_line_items.png", title="Line Items") }}
The allocation table (as shown above) provides an interface to allocate required stock, and also shows the stock allocation progress for each line item in the build.
@@ -139,9 +129,7 @@ The allocation table (as shown above) provides an interface to allocate required
The *Incomplete Outputs* panel shows the list of in-progress [build outputs](./output.md) (created stock items) associated with this build.
{% with id="build_outputs", url="build/build_outputs.png", description="Outputs tab" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_outputs.png", title="Build Outputs") }}
!!! info "Example: Build Outputs"
In the example image above, a single output (serial number 2) has been completed, while serial numbers 1 and 4 are still in progress.
@@ -158,9 +146,7 @@ This panel displays all the completed build outputs (stock items) which have bee
The *Allocated Stock* tab displays all stock items which have been *allocated* to this build order. These stock items are reserved for this build, and will be consumed when the build is completed:
{% with id="allocated_stock_table", url="build/allocated_stock_table.png", description="Allocated Stock Table" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/allocated_stock_table.png", title="Allocated Stock Table") }}
### Consumed Stock
@@ -173,43 +159,27 @@ The *Consumed Stock* tab displays all stock items which have been *consumed* by
If there exist any build orders which are *children* of the selected build order, they are displayed in the *Child Builds* tab:
{% with id="build_childs", url="build/build_childs.png", description="Child builds panel" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_childs.png", title="Child Builds") }}
### Test Results
For *trackable* parts, test results can be recorded against each build output. These results are displayed in the *Test Results* panel:
{% with id="build_test_results", url="build/build_panel_test_results.png", description="Test Results panel" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_panel_test_results.png", title="Test Results") }}
This table provides a summary of the test results for each build output, and allows test results to be quickly added for each build output.
### Test Statistics
For *trackable* parts, this panel displays a summary of the test results for all build outputs:
{% with id="build_test_stats", url="build/build_panel_test_statistics.png", description="Test Statistics panel" %}
{% include "img.html" %}
{% endwith %}
### Attachments
Files attachments can be uploaded against the build order, and displayed in the *Attachments* tab:
{% with id="build_attachments", url="build/build_attachments.png", description="Attachments tab" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_attachments.png", title="Attachments") }}
### Notes
Build order notes (which support markdown formatting) are displayed in the *Notes* tab:
{% with id="build_notes", url="build/build_notes.png", description="Notes tab" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_notes.png", title="Notes") }}
## Create Build Order
@@ -221,9 +191,7 @@ To create a build order for your part, you have two options:
- Select the *Build Orders* tab
- Select *Start new Build*
{% with id="build_create_from_part", url="build/build_create_from_part.png", description="Create build from Part view" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_create_from_part.png", title="Create Build Order from Part") }}
### Build Order Page

View File

@@ -4,53 +4,41 @@ title: Build Order Example
## Build Order Example
For example, let's say we wish to create 10 new "Widgets". We create a new build for the widget, which signals an *intent* to assemble the "Widget" in quantity 10. As the *Widget* is a serialized part, with tracked subcomponents, the build outputs must themselves be serialized. This means that we need to generate 10 separate build outputs for this build order.
For example, let's say we wish to create 10 new "Widgets". We create a new build for the widget, which signals an *intent* to assemble the "Widget" in quantity 10. As the *Widget* is a serialized part, with tracked sub-components, the build outputs must themselves be serialized. This means that we need to generate 10 separate build outputs for this build order.
### Create Build Order
First, create a new build order for the *Widget* assembly:
{% with id="build_example_create", url="build/build_example_create.png", description="Create build order" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_example_create.png", "Create Build Order") }}
### Generate Build Outputs
Generate build outputs for this build order. As this is a tracked item, with tracked subcomponents, the build outputs must be serialized:
Generate build outputs for this build order. As this is a tracked item, with tracked sub-components, the build outputs must be serialized:
{% with id="build_example_create_outputs", url="build/build_example_create_outputs.png", description="Create build outputs" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_example_create_outputs.png", "Create Build Outputs") }}
A list of new build outputs will have now been generated:
{% with id="build_example_incomplete_list", url="build/build_example_incomplete_list.png", description="Incomplete build outputs" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_example_incomplete_list.png", "Incomplete Build Outputs") }}
### Allocate Untracked Stock
Untracked stock items are allocated to the build order in the *Allocate Stock* tab:
{% with id="build_example_allocate_untracked", url="build/build_example_allocate_untracked.png", description="Allocated Untracked Stock" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_example_allocate_untracked.png", "Allocate Untracked Stock") }}
### Allocate Tracked Stock
Tracked stock items are allocated to individual build outputs:
{% with id="build_example_allocate_tracked", url="build/build_example_allocated_tracked.png", description="Allocated Tracked Stock" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_example_allocated_tracked.png", "Allocate Tracked Stock") }}
### Complete Build Outputs
Mark each build output as complete:
{% with id="build_example_complete_outputs", url="build/build_example_complete_outputs.png", description="Complete Build Outputs" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_example_complete_outputs.png", "Complete Build Outputs") }}
### Complete Build Order

View File

@@ -14,25 +14,19 @@ With reference to a [build order](./build.md), a *Build Output* is a finished pr
The *Incomplete Outputs* tab displays any outstanding / in-progress build outputs for the current build order.
{% with id="build-outputs-incomplete", url="build/build_outputs_incomplete.png", description="Incomplete build outputs" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_outputs_incomplete.png", "Incomplete build outputs") }}
### Completed Outputs
The *Completed Outputs* tab displays any [completed](#complete-build-output) or [scrapped](#scrap-build-output) outputs for the current build order.
{% with id="build-outputs-complete", url="build/build_outputs_complete.png", description="Complete build outputs" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_outputs_complete.png", "Completed build outputs") }}
## Create Build Output
Create a new build output by pressing the <span class="badge inventree add">{{ icon("plus-circle") }} New Build Output</span> button under the [incomplete outputs](#incomplete-outputs) tab:
{% with id="build_output_create", url="build/build_output_create.png", description="Create build output" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_output_create.png", "Create build output") }}
### Create Options
@@ -55,9 +49,7 @@ Refer to the [serial number generation guide](../stock/tracking.md#generating-se
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 %}
{{ image("build/build_output_complete.png", "Complete build output") }}
Here the user can select the destination location for the build output, as well as the stock item status.
@@ -84,9 +76,7 @@ The following options are available when completing a build output:
An individual build output is completed by selecting the *Scrap build output* button associated with that build output:
{% with id="build_output_scrap", url="build/build_output_scrap.png", description="Scrap build output" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_output_scrap.png", "Scrap build output") }}
Marking the build output(s) as scrapped performs the following actions:
@@ -109,9 +99,7 @@ The following options are available when scrapping a build order:
*Deleting* a build output causes the build output to be cancelled, and removed from the database entirely. Use this option when the build output does not physically exist (or was never built) and should not be tracked in the database.
{% with id="build_output_delete", url="build/build_output_delete.png", description="Delete build output" %}
{% include "img.html" %}
{% endwith %}
{{ image("build/build_output_delete.png", "Delete build output") }}
Marking the build output(s) as deleted performs the following actions: