mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-12 09:17:13 +00:00
[enhancements] Stock tracking enhancements (#11260)
* Data migrations for StockItemTracking - Propagate the 'part' links * Enable filtering of stock tracking entries by part * Enable filtering by date range * Display stock tracking for part * Table enhancements * Bump API version * Display stock item column * Ensure 'quantity' is recorded for stock tracking entries * Add new global settings * Adds background task for deleting old stock tracking entries * Docs updates * Enhanced docs * Cast quantity to float * Rever data migration * Ensure part link gets created * Improved prefetch for API * Playwright testing * Tweak unit test thresholds --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
@@ -7,7 +7,7 @@ The API schema as documented below is generated using the [drf-spectactular](htt
|
||||
|
||||
## API Version
|
||||
|
||||
This documentation is for API version: `352`
|
||||
This documentation is for API version: `449`
|
||||
|
||||
!!! tip "API Schema History"
|
||||
We track API schema changes, and provide a snapshot of each API schema version in the [API schema repository](https://github.com/inventree/schema/).
|
||||
|
||||
BIN
docs/docs/assets/images/stock/part_tracking_history.png
Normal file
BIN
docs/docs/assets/images/stock/part_tracking_history.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
BIN
docs/docs/assets/images/stock/stock_item_tracking_history.png
Normal file
BIN
docs/docs/assets/images/stock/stock_item_tracking_history.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
@@ -304,6 +304,6 @@ def on_post_build(*args, **kwargs):
|
||||
if missing:
|
||||
raise NotImplementedError(
|
||||
'Missing Settings:\n'
|
||||
+ f"There are {len(missing)} missing settings in the '{group}' group:\n"
|
||||
+ f"There are {len(missing)} missing settings in the '{group}' group:\n- "
|
||||
+ '\n- '.join(missing)
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: Part Stock History
|
||||
title: Part Stocktake
|
||||
---
|
||||
|
||||
## Part Stock History
|
||||
## Part Stocktake
|
||||
|
||||
InvenTree can track the historical stock levels of parts, allowing users to view past stocktake data and generate reports based on this information.
|
||||
InvenTree can record the historical stock levels of parts, allowing users to view past stocktake data and generate reports based on this information.
|
||||
|
||||
A *Stocktake* refers to a "snapshot" of stock levels for a particular part, at a specific point in time. Stocktake information is used for tracking a historical record of the quantity and value of part stock.
|
||||
|
||||
@@ -75,9 +75,9 @@ A dashboard widget is available for generating stocktake reports, which can be a
|
||||
|
||||
Here, the user can specify the report parameters, and then click the *Generate Report* button to generate a new stocktake report based on the specified parameters.
|
||||
|
||||
## Stock History Settings
|
||||
## Stocktake Settings
|
||||
|
||||
There are a number of configuration options available in the [settings view](../settings/global.md):
|
||||
There are a number of configuration options available for controlling the behavior of part stocktake functionality in the [system settings view](../settings/global.md):
|
||||
|
||||
| Name | Description | Default | Units |
|
||||
| ---- | ----------- | ------- | ----- |
|
||||
@@ -87,9 +87,9 @@ There are a number of configuration options available in the [settings view](../
|
||||
{{ globalsetting("STOCKTAKE_DELETE_OLD_ENTRIES")}}
|
||||
{{ globalsetting("STOCKTAKE_DELETE_DAYS") }}
|
||||
|
||||
{{ image("part/part_stocktake_settings.png", "Stock history settings") }}
|
||||
{{ image("part/part_stocktake_settings.png", "Stocktake settings") }}
|
||||
|
||||
### Enable Stock History
|
||||
### Enable Stocktake
|
||||
|
||||
Enable or disable stocktake functionality. Note that by default, stocktake functionality is disabled.
|
||||
|
||||
@@ -97,10 +97,10 @@ Enable or disable stocktake functionality. Note that by default, stocktake funct
|
||||
|
||||
Configure the number of days between generation of [automatic stocktake reports](#automatic-stocktake). If this value is set to zero, automatic stocktake reports will not be generated.
|
||||
|
||||
### Delete Old Stock History Entries
|
||||
### Delete Old Stocktake Entries
|
||||
|
||||
If enabled, stock history entries older than the specified number of days will be automatically deleted from the database.
|
||||
If enabled, stocktake entries older than the specified number of days will be automatically deleted from the database.
|
||||
|
||||
### Stock History Deletion Interval
|
||||
### Stocktake Deletion Interval
|
||||
|
||||
Configure how many days historical stock records are retained in the database.
|
||||
Configure how many days historical stocktake records are retained in the database.
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
title: Stock
|
||||
---
|
||||
|
||||
## Stock Items
|
||||
## Stock Item
|
||||
|
||||
A *Stock Item* is an actual instance of a [*Part*](../part/index.md) item. It represents a physical quantity of the *Part* in a specific location.
|
||||
|
||||
Each Part instance may have multiple stock items associated with it, in various quantities and locations. Additionally, each stock item may have a serial number (if the part is tracked by serial number) and may be associated with a particular supplier part (if the item was purchased from a supplier).
|
||||
|
||||
### Stock Item Details
|
||||
|
||||
The *Stock Item* detail view shows information regarding the particular stock item:
|
||||
Each *Stock Item* is linked to the following information:
|
||||
|
||||
**Part** - Which *Part* this stock item is an instance of
|
||||
|
||||
@@ -26,17 +28,27 @@ The *Stock Item* detail view shows information regarding the particular stock it
|
||||
|
||||
**Status** - Status of this stock item
|
||||
|
||||
### Stock Availability
|
||||
**Serial Number** - If the part is tracked by serial number, the unique serial number of this stock item
|
||||
|
||||
**Batch Code** - If the part is tracked by batch code, the batch code of this stock item
|
||||
|
||||
## Stock Availability
|
||||
|
||||
InvenTree has a number of different mechanisms to determine whether stock is available for use. See the [Stock Availability](./availability.md) page for more information.
|
||||
|
||||
### Stock Tracking
|
||||
## Traceability
|
||||
|
||||
Stock items can be associated with a unique serial number and / or a batch code, which allows for traceability of individual stock items. This is particularly useful for tracking the history of specific items, and for ensuring that items can be traced back to their source (e.g. supplier, purchase order, etc).
|
||||
|
||||
Refer to the [traceability](./traceability.md) page for more information on how serial numbers and batch codes work in InvenTree.
|
||||
|
||||
## Stock Tracking
|
||||
|
||||
Every time a *Stock Item* is adjusted, a *Stock Tracking* entry is automatically created. This ensures a complete history of the *Stock Item* is maintained as long as the item is in the system.
|
||||
|
||||
Each stock tracking historical item records the user who performed the action. [Read more about stock tracking here](./tracking.md).
|
||||
|
||||
## Stock Location
|
||||
## Stock Locations
|
||||
|
||||
A stock location represents a physical real-world location where *Stock Items* are stored. Locations are arranged in a cascading manner and each location may contain multiple sub-locations, or stock, or both.
|
||||
|
||||
@@ -60,3 +72,7 @@ in the build order line items view where the material is allocated.
|
||||
{{ image("stock/stock_external_icon.png", title="External stock indication") }}
|
||||
|
||||
The external flag does not get inherited to sublocations.
|
||||
|
||||
### Structural Locations
|
||||
|
||||
A stock location may be optionally marked as *structural*. Structural locations are used to represent physical locations which are not directly associated with stock items, but rather serve as a means of organizing the stock location hierarchy. For example, a structural location might represent a particular shelf or drawer within a warehouse, while the actual stock items are stored in sub-locations within that location.
|
||||
|
||||
@@ -36,6 +36,8 @@ Refer to the source code for the Stock status codes:
|
||||
show_source: True
|
||||
members: []
|
||||
|
||||
### Custom Status Codes
|
||||
|
||||
Stock Status supports [custom states](../concepts/custom_states.md).
|
||||
|
||||
### Default Status Code
|
||||
|
||||
152
docs/docs/stock/traceability.md
Normal file
152
docs/docs/stock/traceability.md
Normal file
@@ -0,0 +1,152 @@
|
||||
---
|
||||
title: Stock Traceability
|
||||
---
|
||||
|
||||
## Stock Traceability
|
||||
|
||||
It may be desirable to track individual stock items, or groups of stock items, with unique identifier values. Stock items may be *tracked* using either *Batch Codes* or *Serial Numbers*.
|
||||
|
||||
Individual stock items can be assigned a batch code, or a serial number, or both, or neither, as requirements dictate.
|
||||
|
||||
{{ image("stock/batch_and_serial.png", title="Batch and Serial Number Tracking") }}
|
||||
|
||||
Out of the box, the default implementations for both batch codes and serial numbers are (intentionally) simplistic.
|
||||
|
||||
As the particular requirements for serial number or batch code conventions may vary significantly from one application to another, InvenTree provides the ability for custom plugins to determine exactly how batch codes and serial numbers are implemented.
|
||||
|
||||
### Batch Codes
|
||||
|
||||
Batch codes can be used to specify a particular "group" of items, and can be assigned to any stock item without restriction. Batch codes are tracked even as stock items are split into separate items.
|
||||
|
||||
Multiple stock items may share the same batch code without restriction, even across different parts.
|
||||
|
||||
#### Generating Batch Codes
|
||||
|
||||
Batch codes can be generated automatically based on a provided pattern. The default pattern simply uses the current date-code as the batch number, however this can be customized within a certain scope.
|
||||
|
||||
{{ image("stock/batch_code_template.png", title="Batch code pattern") }}
|
||||
|
||||
#### Context Variables
|
||||
|
||||
The following context variables are available by default when generating a batch code using the builtin generation functionality:
|
||||
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
| year | The current year e.g. `2024` |
|
||||
| month | The current month number, e.g. `5` |
|
||||
| day | The current day of month, e.g. `21` |
|
||||
| hour | The current hour of day, in 24-hour format, e.g. `23` |
|
||||
| minute | The current minute of hour, e.g. `17` |
|
||||
| week | The current week of year, e.g. `51` |
|
||||
|
||||
#### Plugin Support
|
||||
|
||||
To implement custom batch code functionality, refer to the details on the [Validation Plugin Mixin](../plugins/mixins/validation.md#batch-codes).
|
||||
|
||||
### Serial Numbers
|
||||
|
||||
A serial "number" is used to uniquely identify a single, unique stock item. Note that while *number* is used throughout the documentation, these values are not required to be numeric.
|
||||
|
||||
#### Uniqueness Requirements
|
||||
|
||||
By default, serial numbers must be unique across any given [Part](../part/index.md) instance (including any variants of that part).
|
||||
|
||||
However, it is also possible to specify that serial numbers must be globally unique across all types of parts. This is configurable in the settings display (see below):
|
||||
|
||||
{{ image("stock/serial_numbers_unique.png", title="Serial number uniqueness") }}
|
||||
|
||||
#### Generating Serial Numbers
|
||||
|
||||
When creating a group of serialized stock items, it can be very useful for the user to be able to generate a group of unique serial numbers, with one serial number for each serialized stock item.
|
||||
|
||||
{{ image("stock/serial_next.png", title="Serial number entry") }}
|
||||
|
||||
For a given serial number *schema* (either the in-built schema or a custom schema defined by a plugin), a group (or *range*) of serial numbers can be generated using a number of possible patterns:
|
||||
|
||||
##### Comma Separated Values
|
||||
|
||||
Individual serial numbers can be specified by separating using a comma character (`,`).
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `1, 2, 45, 99, 101` | `1, 2, 45, 99, 101` |
|
||||
|
||||
##### Hyphen Separated Range
|
||||
|
||||
Use a hyphen character (`-`) to specify a *range* of sequential values, inclusive of the two values separated by the hyphen.
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `10-15` | `10, 11, 12, 13, 14, 15` |
|
||||
|
||||
##### Starting Value Range
|
||||
|
||||
A *starting value* can be supplied, followed by the plus (`+`) character to indicate a number of sequential values following the provided starting value. The `+` character should be followed by an integer value to indicate the number of serial numbers which will be generated.
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `10+3` | `10, 11, 12, 13` |
|
||||
| `100 + 2` | `100, 101, 102` |
|
||||
|
||||
##### Next Value
|
||||
|
||||
When specifying serial numbers, the tilde (`~`) character is replaced with the next available serial number. It can be used in combination with the available patterns specified above.
|
||||
|
||||
For example, if the *next* available serial number is `100`, the following patterns can be used:
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `~` | `100` |
|
||||
| `~, ~, ~` | `100, 101, 102` |
|
||||
| `800, ~, 900` | `800, 100, 900` |
|
||||
| `~+5` | `100, 101, 102, 103, 104, 105` |
|
||||
|
||||
##### Combination Groups
|
||||
|
||||
Any of the above patterns can be combined using multiple groups separated by the comma (`,`) character:
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `1, 2, 4-7, 10` | `1, 2, 4, 5, 6, 7, 10` |
|
||||
| `40+4, 50+4` | `40, 41, 42, 43, 44, 50, 51, 52, 53, 54` |
|
||||
| `10, 14, 20+3, 30-35` | `10, 14, 20, 21, 22, 23, 30, 31, 32, 33, 34, 35` |
|
||||
|
||||
In the default implementation, InvenTree assumes that serial "numbers" are integer values in a simple incrementing sequence e.g. `{1, 2, 3, 4, 5, 6}`. When generating the *next* value for a serial number, the algorithm looks for the *most recent* serial number, and attempts to coerce that value into an integer, and then increment that value.
|
||||
|
||||
While this approach is reasonably robust, it is definitely simplistic and is not expected to meet the requirements of every installation. For this reason, more complex serial number management is intended to be implemented using a custom plugin (see below).
|
||||
|
||||
#### Serial Number Errors
|
||||
|
||||
If a provided serial number (or group of numbers) is not considered valid, an error message is provided to the user.
|
||||
|
||||
##### Example: Invalid Quantity
|
||||
|
||||
{{ image("stock/serial_error_quantity.png", title="Serial number - invalid quantity") }}
|
||||
|
||||
##### Example: Duplicate Serial Numbers
|
||||
|
||||
{{ image("stock/serial_error_unique.png", title="Serial number - duplicate values") }}
|
||||
|
||||
##### Example: Invalid Serial Numbers
|
||||
|
||||
!!! tip "Serial Number Validation"
|
||||
Custom serial number validation can be implemented using an external plugin
|
||||
|
||||
#### Adjusting Serial Numbers
|
||||
|
||||
Once a stock item has been created with a serial number, it is possible to adjust that serial number value if required. This can be achieved by navigating to the stock item's detail page, and selecting the "Edit" option from the actions menu. Here, the serial number value can be modified as required:
|
||||
|
||||
{{ image("stock/serial_edit.png", title="Editing a serial number") }}
|
||||
|
||||
Note that any serial number adjustments are subject to the same validation rules as when the stock item was created. If the new serial number value is not valid, an error message will be displayed to the user:
|
||||
|
||||
{{ image("stock/serial_edit_error.png", title="Error while editing a serial number") }}
|
||||
|
||||
|
||||
#### Plugin Support
|
||||
|
||||
Custom serial number functionality, with any arbitrary requirements or level of complexity, can be implemented using the [Validation Plugin Mixin class](../plugins/mixins/validation.md#serial-numbers). Refer to the documentation for this plugin for technical details.
|
||||
|
||||
A custom plugin allows the user to determine how a "valid" serial number is defined, and (crucially) how any given serial number value is incremented to provide the next value in the sequence.
|
||||
|
||||
Implementing custom methods for these two considerations allows for complex serial number schema to be supported with minimal effort.
|
||||
@@ -4,149 +4,47 @@ title: Stock Tracking
|
||||
|
||||
## Stock Tracking
|
||||
|
||||
It may be desirable to track individual stock items, or groups of stock items, with unique identifier values. Stock items may be *tracked* using either *Batch Codes* or *Serial Numbers*.
|
||||
Stock tracking entries record the history of stock item adjustments, including the user who performed the action, the date of the action, and the quantity change. This allows users to maintain a complete history of stock item movements and adjustments over time.
|
||||
|
||||
Individual stock items can be assigned a batch code, or a serial number, or both, or neither, as requirements dictate.
|
||||
### Tracking Events
|
||||
|
||||
{{ image("stock/batch_and_serial.png", title="Batch and Serial Number Tracking") }}
|
||||
Stock tracking entries are created automatically whenever a stock item is adjusted, either through manual adjustments or through automated processes such as order fulfillment or build completion.
|
||||
|
||||
Out of the box, the default implementations for both batch codes and serial numbers are (intentionally) simplistic.
|
||||
Some examples of events that may trigger stock tracking entries include:
|
||||
|
||||
As the particular requirements for serial number or batch code conventions may vary significantly from one application to another, InvenTree provides the ability for custom plugins to determine exactly how batch codes and serial numbers are implemented.
|
||||
- Manual stock adjustments (e.g. correcting inventory counts)
|
||||
- Creation of new stock items (e.g. receiving new inventory)
|
||||
- Allocation of stock items to orders (e.g. shipping items against sales orders)
|
||||
- Consumption of stock items during build processes (e.g. using items to complete a build order)
|
||||
|
||||
### Batch Codes
|
||||
## Viewing Stock Tracking History
|
||||
|
||||
Batch codes can be used to specify a particular "group" of items, and can be assigned to any stock item without restriction. Batch codes are tracked even as stock items are split into separate items.
|
||||
There are multiple ways to view the stock tracking history for a particular stock item or part via the user interface.
|
||||
|
||||
Multiple stock items may share the same batch code without restriction, even across different parts.
|
||||
### Stock Item Tracking History
|
||||
|
||||
#### Generating Batch Codes
|
||||
The stock tracking history for a particular stock item can be viewed on the *Stock Item Detail* page, under the *Stock Tracking* tab:
|
||||
|
||||
Batch codes can be generated automatically based on a provided pattern. The default pattern simply uses the current date-code as the batch number, however this can be customized within a certain scope.
|
||||
{{ image("stock/stock_item_tracking_history.png", title="Stock tracking tab") }}
|
||||
|
||||
{{ image("stock/batch_code_template.png", title="Batch code pattern") }}
|
||||
This view displays all tracking entries associated with the particular stock item.
|
||||
|
||||
#### Context Variables
|
||||
### Part Tracking History
|
||||
|
||||
The following context variables are available by default when generating a batch code using the builtin generation functionality:
|
||||
Additionally, the stock tracking history for a particular part can be viewed on the *Part Detail* page, under the *Stock History* tab:
|
||||
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
| year | The current year e.g. `2024` |
|
||||
| month | The current month number, e.g. `5` |
|
||||
| day | The current day of month, e.g. `21` |
|
||||
| hour | The current hour of day, in 24-hour format, e.g. `23` |
|
||||
| minute | The current minute of hour, e.g. `17` |
|
||||
| week | The current week of year, e.g. `51` |
|
||||
{{ image("stock/part_tracking_history.png", title="Part stock tracking history") }}
|
||||
|
||||
#### Plugin Support
|
||||
This view displays all tracking entries associated with any stock item linked to the particular part.
|
||||
|
||||
To implement custom batch code functionality, refer to the details on the [Validation Plugin Mixin](../plugins/mixins/validation.md#batch-codes).
|
||||
!!! info "Deleted Stock Items"
|
||||
Even if a stock item is deleted from the system, the associated stock tracking entries are retained for historical reference. They will be visible in the part tracking history, but not in the stock item tracking history (as the stock item itself has been deleted).
|
||||
|
||||
### Serial Numbers
|
||||
## Stock Tracking Settings
|
||||
|
||||
A serial "number" is used to uniquely identify a single, unique stock item. Note that while *number* is used throughout the documentation, these values are not required to be numeric.
|
||||
There are a number of configuration options available for controlling the behavior of stock tracking functionality in the [system settings view](../settings/global.md):
|
||||
|
||||
#### Uniqueness Requirements
|
||||
|
||||
By default, serial numbers must be unique across any given [Part](../part/index.md) instance (including any variants of that part).
|
||||
|
||||
However, it is also possible to specify that serial numbers must be globally unique across all types of parts. This is configurable in the settings display (see below):
|
||||
|
||||
{{ image("stock/serial_numbers_unique.png", title="Serial number uniqueness") }}
|
||||
|
||||
#### Generating Serial Numbers
|
||||
|
||||
When creating a group of serialized stock items, it can be very useful for the user to be able to generate a group of unique serial numbers, with one serial number for each serialized stock item.
|
||||
|
||||
{{ image("stock/serial_next.png", title="Serial number entry") }}
|
||||
|
||||
For a given serial number *schema* (either the in-built schema or a custom schema defined by a plugin), a group (or *range*) of serial numbers can be generated using a number of possible patterns:
|
||||
|
||||
##### Comma Separated Values
|
||||
|
||||
Individual serial numbers can be specified by separating using a comma character (`,`).
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `1, 2, 45, 99, 101` | `1, 2, 45, 99, 101` |
|
||||
|
||||
##### Hyphen Separated Range
|
||||
|
||||
Use a hyphen character (`-`) to specify a *range* of sequential values, inclusive of the two values separated by the hyphen.
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `10-15` | `10, 11, 12, 13, 14, 15` |
|
||||
|
||||
##### Starting Value Range
|
||||
|
||||
A *starting value* can be supplied, followed by the plus (`+`) character to indicate a number of sequential values following the provided starting value. The `+` character should be followed by an integer value to indicate the number of serial numbers which will be generated.
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `10+3` | `10, 11, 12, 13` |
|
||||
| `100 + 2` | `100, 101, 102` |
|
||||
|
||||
##### Next Value
|
||||
|
||||
When specifying serial numbers, the tilde (`~`) character is replaced with the next available serial number. It can be used in combination with the available patterns specified above.
|
||||
|
||||
For example, if the *next* available serial number is `100`, the following patterns can be used:
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `~` | `100` |
|
||||
| `~, ~, ~` | `100, 101, 102` |
|
||||
| `800, ~, 900` | `800, 100, 900` |
|
||||
| `~+5` | `100, 101, 102, 103, 104, 105` |
|
||||
|
||||
##### Combination Groups
|
||||
|
||||
Any of the above patterns can be combined using multiple groups separated by the comma (`,`) character:
|
||||
|
||||
| Pattern | Serial Numbers |
|
||||
| --- | --- |
|
||||
| `1, 2, 4-7, 10` | `1, 2, 4, 5, 6, 7, 10` |
|
||||
| `40+4, 50+4` | `40, 41, 42, 43, 44, 50, 51, 52, 53, 54` |
|
||||
| `10, 14, 20+3, 30-35` | `10, 14, 20, 21, 22, 23, 30, 31, 32, 33, 34, 35` |
|
||||
|
||||
In the default implementation, InvenTree assumes that serial "numbers" are integer values in a simple incrementing sequence e.g. `{1, 2, 3, 4, 5, 6}`. When generating the *next* value for a serial number, the algorithm looks for the *most recent* serial number, and attempts to coerce that value into an integer, and then increment that value.
|
||||
|
||||
While this approach is reasonably robust, it is definitely simplistic and is not expected to meet the requirements of every installation. For this reason, more complex serial number management is intended to be implemented using a custom plugin (see below).
|
||||
|
||||
#### Serial Number Errors
|
||||
|
||||
If a provided serial number (or group of numbers) is not considered valid, an error message is provided to the user.
|
||||
|
||||
##### Example: Invalid Quantity
|
||||
|
||||
{{ image("stock/serial_error_quantity.png", title="Serial number - invalid quantity") }}
|
||||
|
||||
##### Example: Duplicate Serial Numbers
|
||||
|
||||
{{ image("stock/serial_error_unique.png", title="Serial number - duplicate values") }}
|
||||
|
||||
##### Example: Invalid Serial Numbers
|
||||
|
||||
!!! tip "Serial Number Validation"
|
||||
Custom serial number validation can be implemented using an external plugin
|
||||
|
||||
#### Adjusting Serial Numbers
|
||||
|
||||
Once a stock item has been created with a serial number, it is possible to adjust that serial number value if required. This can be achieved by navigating to the stock item's detail page, and selecting the "Edit" option from the actions menu. Here, the serial number value can be modified as required:
|
||||
|
||||
{{ image("stock/serial_edit.png", title="Editing a serial number") }}
|
||||
|
||||
Note that any serial number adjustments are subject to the same validation rules as when the stock item was created. If the new serial number value is not valid, an error message will be displayed to the user:
|
||||
|
||||
{{ image("stock/serial_edit_error.png", title="Error while editing a serial number") }}
|
||||
|
||||
|
||||
#### Plugin Support
|
||||
|
||||
Custom serial number functionality, with any arbitrary requirements or level of complexity, can be implemented using the [Validation Plugin Mixin class](../plugins/mixins/validation.md#serial-numbers). Refer to the documentation for this plugin for technical details.
|
||||
|
||||
A custom plugin allows the user to determine how a "valid" serial number is defined, and (crucially) how any given serial number value is incremented to provide the next value in the sequence.
|
||||
|
||||
Implementing custom methods for these two considerations allows for complex serial number schema to be supported with minimal effort.
|
||||
| Name | Description | Default | Units |
|
||||
| ---- | ----------- | ------- | ----- |
|
||||
{{ globalsetting("STOCK_TRACKING_DELETE_OLD_ENTRIES") }}
|
||||
{{ globalsetting("STOCK_TRACKING_DELETE_DAYS") }}
|
||||
|
||||
@@ -138,6 +138,7 @@ nav:
|
||||
- Stock:
|
||||
- Stock Items: stock/index.md
|
||||
- Availability: stock/availability.md
|
||||
- Traceability: stock/traceability.md
|
||||
- Stock Tracking: stock/tracking.md
|
||||
- Stock Status: stock/status.md
|
||||
- Adjusting Stock: stock/adjust.md
|
||||
|
||||
Reference in New Issue
Block a user