@@ -613,8 +627,122 @@ function completeBuildOutputs(build_id, outputs, options={}) {
+/*
+ * Launch a modal form to scrap selected build outputs.
+ * Scrapped outputs are marked as "complete", but with the "rejected" code
+ * These outputs are not included in build completion calculations.
+ */
+function scrapBuildOutputs(build_id, outputs, options={}) {
+
+ if (outputs.length == 0) {
+ showAlertDialog(
+ '{% trans "Select Build Outputs" %}',
+ '{% trans "At least one build output must be selected" %}',
+ );
+ return;
+ }
+
+ let table_entries = '';
+
+ outputs.forEach(function(output) {
+ table_entries += renderBuildOutput(output);
+ });
+
+ var html = `
+
+ {% trans "Selected build outputs will be marked as scrapped" %}
+
+
{% trans "Scrapped output are given the 'rejected' status" %}
+
{% trans "Allocated stock items will no longer be available" %}
+
{% trans "The completion status of the build order will not be adjusted" %}
diff --git a/docs/docs/assets/images/build/build_example_allocate_untracked.png b/docs/docs/assets/images/build/build_example_allocate_untracked.png
new file mode 100644
index 0000000000..95cd85fa77
Binary files /dev/null and b/docs/docs/assets/images/build/build_example_allocate_untracked.png differ
diff --git a/docs/docs/assets/images/build/build_example_allocated_tracked.png b/docs/docs/assets/images/build/build_example_allocated_tracked.png
new file mode 100644
index 0000000000..9f2b2dae7e
Binary files /dev/null and b/docs/docs/assets/images/build/build_example_allocated_tracked.png differ
diff --git a/docs/docs/assets/images/build/build_example_complete_outputs.png b/docs/docs/assets/images/build/build_example_complete_outputs.png
new file mode 100644
index 0000000000..7a3382af9a
Binary files /dev/null and b/docs/docs/assets/images/build/build_example_complete_outputs.png differ
diff --git a/docs/docs/assets/images/build/build_example_create.png b/docs/docs/assets/images/build/build_example_create.png
new file mode 100644
index 0000000000..e62d438543
Binary files /dev/null and b/docs/docs/assets/images/build/build_example_create.png differ
diff --git a/docs/docs/assets/images/build/build_example_create_outputs.png b/docs/docs/assets/images/build/build_example_create_outputs.png
new file mode 100644
index 0000000000..1606728039
Binary files /dev/null and b/docs/docs/assets/images/build/build_example_create_outputs.png differ
diff --git a/docs/docs/assets/images/build/build_example_incomplete_list.png b/docs/docs/assets/images/build/build_example_incomplete_list.png
new file mode 100644
index 0000000000..a6fbd37d5b
Binary files /dev/null and b/docs/docs/assets/images/build/build_example_incomplete_list.png differ
diff --git a/docs/docs/assets/images/build/build_output_complete.png b/docs/docs/assets/images/build/build_output_complete.png
index c729493087..6583cbddf2 100644
Binary files a/docs/docs/assets/images/build/build_output_complete.png and b/docs/docs/assets/images/build/build_output_complete.png differ
diff --git a/docs/docs/assets/images/build/build_output_create.png b/docs/docs/assets/images/build/build_output_create.png
new file mode 100644
index 0000000000..5b29ceb26e
Binary files /dev/null and b/docs/docs/assets/images/build/build_output_create.png differ
diff --git a/docs/docs/assets/images/build/build_output_delete.png b/docs/docs/assets/images/build/build_output_delete.png
new file mode 100644
index 0000000000..523ace3a2b
Binary files /dev/null and b/docs/docs/assets/images/build/build_output_delete.png differ
diff --git a/docs/docs/assets/images/build/build_output_scrap.png b/docs/docs/assets/images/build/build_output_scrap.png
new file mode 100644
index 0000000000..91ab653f89
Binary files /dev/null and b/docs/docs/assets/images/build/build_output_scrap.png differ
diff --git a/docs/docs/assets/images/build/build_outputs_complete.png b/docs/docs/assets/images/build/build_outputs_complete.png
new file mode 100644
index 0000000000..a35866e948
Binary files /dev/null and b/docs/docs/assets/images/build/build_outputs_complete.png differ
diff --git a/docs/docs/assets/images/build/build_outputs_incomplete.png b/docs/docs/assets/images/build/build_outputs_incomplete.png
new file mode 100644
index 0000000000..746206ed9a
Binary files /dev/null and b/docs/docs/assets/images/build/build_outputs_incomplete.png differ
diff --git a/docs/docs/assets/images/stock/stock_status_change_multiple.png b/docs/docs/assets/images/stock/stock_status_change_multiple.png
deleted file mode 100644
index 245761aac8..0000000000
Binary files a/docs/docs/assets/images/stock/stock_status_change_multiple.png and /dev/null differ
diff --git a/docs/docs/assets/images/stock/stock_status_change_multiple_done.png b/docs/docs/assets/images/stock/stock_status_change_multiple_done.png
deleted file mode 100644
index f2e928d874..0000000000
Binary files a/docs/docs/assets/images/stock/stock_status_change_multiple_done.png and /dev/null differ
diff --git a/docs/docs/assets/images/stock/stock_status_edit.png b/docs/docs/assets/images/stock/stock_status_edit.png
new file mode 100644
index 0000000000..0c4793437b
Binary files /dev/null and b/docs/docs/assets/images/stock/stock_status_edit.png differ
diff --git a/docs/docs/assets/images/stock/stock_status_edit_multiple.png b/docs/docs/assets/images/stock/stock_status_edit_multiple.png
new file mode 100644
index 0000000000..d7d108c2e5
Binary files /dev/null and b/docs/docs/assets/images/stock/stock_status_edit_multiple.png differ
diff --git a/docs/docs/assets/images/stock/stock_status_label.png b/docs/docs/assets/images/stock/stock_status_label.png
index cc35420231..4102694972 100644
Binary files a/docs/docs/assets/images/stock/stock_status_label.png and b/docs/docs/assets/images/stock/stock_status_label.png differ
diff --git a/docs/docs/assets/images/stock/stock_status_label_updated.png b/docs/docs/assets/images/stock/stock_status_label_updated.png
deleted file mode 100644
index eb91a1bcdf..0000000000
Binary files a/docs/docs/assets/images/stock/stock_status_label_updated.png and /dev/null differ
diff --git a/docs/docs/build/allocate.md b/docs/docs/build/allocate.md
index 20597709cf..9f7eb874a4 100644
--- a/docs/docs/build/allocate.md
+++ b/docs/docs/build/allocate.md
@@ -131,16 +131,6 @@ Here we can see that the incomplete build outputs (serial numbers 15 and 14) now
- Serial number 15 has been fully allocated, and can be completed
- Serial number 14 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.
@@ -151,7 +141,7 @@ Here the user can select the destination location for the build output, as well
## 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.
+ A build order cannot be completed if there are outstanding build outputs. Ensure that all [build outputs](./output.md) are completed first.
Once all build outputs have been completed, the build order itself can be completed by selecting the *Complete Build* button:
diff --git a/docs/docs/build/build.md b/docs/docs/build/build.md
index a27526871f..1736023e10 100644
--- a/docs/docs/build/build.md
+++ b/docs/docs/build/build.md
@@ -66,8 +66,7 @@ The following parameters are available for each Build Order, and can be edited b
A *Build Output* creates a new stock instance of the assembly part, of a specified quantity. Each *Build Order* requires at least one build output. Multiple build outputs can be specified if the build is completed in batches.
-!!! info "Example - Build Outputs"
- 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. We can produce 5 widgets in a single day, and so we create 2 build outputs, each of quantity 5.
+Read more about build outputs [here](./output.md).
### Build Status
@@ -125,7 +124,7 @@ The allocation table (as shown above) shows the stock allocation progress for th
### Build Outputs
-The *Build Outputs* tab shows the outputs (created stock items) associated with this build.
+The *Build Outputs* tab shows the [build outputs](./output.md) (created stock items) associated with this build.
As shown below, there are separate panels for *incomplete* and *completed* build outputs.
diff --git a/docs/docs/build/example.md b/docs/docs/build/example.md
new file mode 100644
index 0000000000..624f83fa95
--- /dev/null
+++ b/docs/docs/build/example.md
@@ -0,0 +1,57 @@
+---
+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.
+
+### 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 %}
+
+### 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:
+
+{% with id="build_example_create_outputs", url="build/build_example_create_outputs.png", description="Create build outputs" %}
+{% include "img.html" %}
+{% endwith %}
+
+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 %}
+
+### 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 %}
+
+### 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 %}
+
+### 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 %}
+
+### Complete Build Order
+
+Once the build outputs have been completed, and all stock has been allocated, the build order can be completed.
diff --git a/docs/docs/build/output.md b/docs/docs/build/output.md
new file mode 100644
index 0000000000..ebccedc338
--- /dev/null
+++ b/docs/docs/build/output.md
@@ -0,0 +1,119 @@
+---
+title: Build Outputs
+---
+
+## Build Outputs
+
+With reference to a [build order](./build.md), a *Build Output* is a finished product which is expected to be produced by completing the order.
+
+- A single build order may have multiple build outputs which are produced at different times or by different operators.
+- An individual build output may be a single unit, or a batch of units
+- Serial numbers and batch codes can be associated with a build output
+
+### Incomplete Outputs
+
+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 %}
+
+### 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 %}
+
+## Create Build Output
+
+Create a new build output by pressing the New Build Output 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 %}
+
+### Create Options
+
+The following options are available when creating a new build output:
+
+| Option | Description |
+| --- | --- |
+| Quantity | The number of items to create as part of this build output |
+| Serial Numbers | If this is a tracked build output, the serial numbers for each of the generated outputs |
+| Batch Code | Batch code identifier for the generated output(s) |
+| Auto Allocate Serial Numbers | If selected, any available tracked subcomponents which already have serial numbers assigned, will be automatically assigned to matching build outputs |
+
+### Specifying Serial Numbers
+
+Refer to the [serial number generation guide](../stock/tracking.md#generating-serial-numbers) for further information on serial number input.
+
+## Complete Build Output
+
+*Completing* a build output marks that output as finished, in the context of the given build order.
+
+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.
+
+Marking the build output(s) as complete performs the following actions:
+
+- The completed build quantity is increased by the quantity of the selected build output(s)
+- The build output(s) are marked as "completed", and available for stock actions
+- Any [tracked BOM items](./allocate.md#allocating-tracked-stock) which are allocated to the build output are *installed* into that build output.
+
+### Complete Options
+
+The following options are available when completing a build output:
+
+| Option | Description |
+| --- | --- |
+| Status | The [stock status](../stock/status.md) for the completed outputs |
+| Location | The [stock location](../stock/stock.md#stock-location) where the outputs will be located |
+| Notes | Any additional notes associated with the completion of these outputs |
+| Accept Incomplete Allocation | If selected, this option allows [tracked build outputs](./allocate.md#tracked-build-outputs) to be completed in the case where required BOM items have not been fully allocated |
+
+## Scrap Build Output
+
+*Scrapping* a build output marks the particular output as rejected, in the context of the given build order.
+
+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 %}
+
+Marking the build output(s) as scrapped performs the following actions:
+
+- The build outputs are marked as "rejected" and removed from the build
+- The completed build quantity *does not increase*
+- The build outputs are not available for any further stock actions
+- Optionally, any [tracked BOM items](./allocate.md#allocating-tracked-stock) which are allocated to the build output are *installed* into the rejected build output
+
+### Scrap Options
+
+The following options are available when scrapping a build order:
+
+| Option | Description |
+| --- | --- |
+| Location | The stock location where the scrapped build output(s) will be located |
+| Notes | Any additional notes associated with the scrapping of these outputs |
+| Discard Allocations | If selected, any installed BOM items will be removed first, before marking the build output as scrapped. Use this option if the installed items are recoverable and can be used elsewhere |
+
+## Delete Build Output
+
+*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 %}
+
+Marking the build output(s) as deleted performs the following actions:
+
+- Any allocated stock items are returned to stock
+- The build output is removed from the database
diff --git a/docs/docs/stock/status.md b/docs/docs/stock/status.md
index e8dcf96611..42e5bffe32 100644
--- a/docs/docs/stock/status.md
+++ b/docs/docs/stock/status.md
@@ -4,39 +4,36 @@ title: Stock Status
## Stock Status
-Stock status serves at categorizing and identifying the state of stock items.
+Each [Stock Item](./stock.md#stock-item) has a *status* attribute, which serves to identify the current condition of the individual stock item.
-Below is the current list of stock status and their proposed meaning:
+Certain stock item status codes will restrict the availability of the stock item.
-| Status | Description |
-| ----------- | ----------- |
-| OK | Stock item is healthy, nothing wrong to report |
-| Attention needed | Stock item hasn't been checked or tested yet |
-| Damaged | Stock item is not functional in its present state |
-| Destroyed | Stock item has been destroyed |
-| Lost | Stock item has been lost |
-| Rejected | Stock item did not pass the quality control standards |
-| Returned | Stock item was returned to seller (if bought) or is a customer return (if sold) |
-| Quarantined | Stock item has been intentionally isolated and it unavailable |
+Below is the list of available stock status codes and their meaning:
-Stock status code will remove the stock from certain operations. For instance, users can't add "destroyed" or "lost" stock to a sales order.
+| Status | Description | Available |
+| ----------- | ----------- | --- |
+| OK | Stock item is healthy, nothing wrong to report | Yes |
+| Attention needed | Stock item hasn't been checked or tested yet | Yes |
+| Damaged | Stock item is not functional in its present state | Yes |
+| Destroyed | Stock item has been destroyed | No |
+| Lost | Stock item has been lost | No |
+| Rejected | Stock item did not pass the quality control standards | No |
+| Quarantined | Stock item has been intentionally isolated and it unavailable | No |
-The stock status is displayed as a label in the header of each stock item detail page, for instance here the stock status is "OK":
+The *status* of a given stock item is displayed on the stock item detail page:
{% with id="stock_status_label", url="stock/stock_status_label.png", description="Stock Status Label" %}
{% include 'img.html' %}
{% endwith %}
+### Default Status Code
+
+The default status code for any newly created Stock Item is OK
+
## Update Status
-In the "Stock" tab of the part view, select all stock items which stock status needs to be updated:
+To update the status code for an individual stock item, open the *Edit Stock Item* dialog and then select the required status code in the *Status* field
-{% with id="stock_status_change_multiple", url="stock/stock_status_change_multiple.png", description="Stock Status Status Multiple" %}
-{% include 'img.html' %}
-{% endwith %}
-
-Click on `Stock Options > Change stock status`, select the new status then submit. All selected stock items status will be automatically updated:
-
-{% with id="stock_status_change_multiple_done", url="stock/stock_status_change_multiple_done.png", description="Stock Status Status Multiple Done" %}
+{% with id="stock_status_edit", url="stock/stock_status_edit.png", description="Edit stock item status" %}
{% include 'img.html' %}
{% endwith %}
diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css
index 5f2db992eb..3641b1f2cb 100644
--- a/docs/docs/stylesheets/extra.css
+++ b/docs/docs/stylesheets/extra.css
@@ -135,3 +135,22 @@ div:nth-of-type(1) p {
margin: 5px;
margin-bottom: 0px;
}
+
+.badge.inventree.success {
+ background-color: #5cb85c;
+ color: #555;
+}
+
+.badge.inventree.warning {
+ background-color: #f0ad4e;
+ color: #555;
+}
+
+.badge.inventree.danger {
+ background-color: #d9534f;
+}
+
+.badge.inventree.info {
+ background-color: #5bc0de;
+ color: #555;
+}
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index f4c3690803..0a3199306f 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -99,7 +99,9 @@ nav:
- Test Results: stock/test.md
- Build:
- Build Orders: build/build.md
+ - Build Outputs: build/output.md
- Allocating Stock: build/allocate.md
+ - Example Build Order: build/example.md
- Bill of Materials: build/bom.md
- Importing BOM Data: build/bom_import.md
- Exporting BOM Data: build/bom_export.md