mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-02 10:18:42 +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:
@@ -11,9 +11,7 @@ When a certain (server-side) event occurs, the background worker passes the even
|
||||
!!! tip "Enable Event Integration"
|
||||
The *Enable Event Integration* option must first be enabled to allow plugins to respond to events.
|
||||
|
||||
{% with id="events", url="plugin/enable_events.png", description="Enable event integration" %}
|
||||
{% include 'img.html' %}
|
||||
{% endwith %}
|
||||
{{ image("plugin/enable_events.png", "Enable event integration") }}
|
||||
|
||||
## Events
|
||||
|
||||
|
||||
@@ -21,9 +21,10 @@ Each plugin can dictate which datasets are supported using the `supports_export`
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
The default implementation returns `True` for all data types.
|
||||
|
||||
@@ -36,9 +37,10 @@ The `generate_filename` method constructs a filename for the exported file.
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
### Adjust Columns
|
||||
|
||||
@@ -49,9 +51,10 @@ The `update_headers` method allows the plugin to adjust the columns selected to
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
### Queryset Filtering
|
||||
|
||||
@@ -62,9 +65,10 @@ The `filter_queryset` method allows the plugin to provide custom filtering to th
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
### Export Data
|
||||
|
||||
@@ -75,9 +79,10 @@ The `export_data` method performs the step of transforming a [Django QuerySet]({
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
Note that the default implementation simply uses the builtin tabulation functionality of the provided serializer class. In most cases, this will be sufficient.
|
||||
|
||||
|
||||
@@ -112,9 +112,7 @@ To merge (combine) multiple labels into a single output (for example printing mu
|
||||
|
||||
If label printing plugins are enabled, they are able to be used directly from the InvenTree web interface:
|
||||
|
||||
{% with id="label_print", url="plugin/print_label_select_plugin.png", description="Print label via plugin" %}
|
||||
{% include 'img.html' %}
|
||||
{% endwith %}
|
||||
{{ image("plugin/print_label_select_plugin.png", "Print label via plugin") }}
|
||||
|
||||
### App Integration
|
||||
|
||||
|
||||
@@ -14,17 +14,13 @@ The possibilities are endless!
|
||||
|
||||
### Web Integration
|
||||
|
||||
{% with id="web_locate", url="plugin/web_locate.png", description="Locate stock item from web interface", maxheight="400px" %}
|
||||
{% include 'img.html' %}
|
||||
{% endwith %}
|
||||
{{ image("plugin/web_locate.png", "Locate stock item from web interface", maxheight="400px") }}
|
||||
|
||||
### App Integration
|
||||
|
||||
If a locate plugin is installed and activated, the [InvenTree mobile app](../../app/index.md) displays a button for locating a StockItem or StockLocation (see below):
|
||||
|
||||
{% with id="app_locate", url="plugin/app_locate.png", description="Locate stock item from app", maxheight="400px" %}
|
||||
{% include 'img.html' %}
|
||||
{% endwith %}
|
||||
{{ image("plugin/app_locate.png", "Locate stock item from app", maxheight="400px") }}
|
||||
|
||||
### Implementation
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ The ScheduleMixin class provides a plugin with the ability to call functions at
|
||||
!!! tip "Enable Schedule Integration"
|
||||
The *Enable Schedule Integration* option but be enabled, for scheduled plugin events to be activated.
|
||||
|
||||
{% with id="schedule", url="plugin/enable_schedule.png", description="Enable schedule integration" %}
|
||||
{% include 'img.html' %}
|
||||
{% endwith %}
|
||||
{{ image("plugin/enable_schedule.png", "Enable schedule integration") }}
|
||||
|
||||
### SamplePlugin
|
||||
|
||||
|
||||
@@ -21,9 +21,10 @@ The entrypoint for user interface plugins is the `UserInterfaceMixin` class, whi
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
Note here that the `get_ui_features` calls other methods to extract the available features from the plugin, based on the requested feature type. These methods can be overridden to provide custom functionality.
|
||||
|
||||
@@ -39,9 +40,10 @@ The `get_ui_features` method should return a list of `UIFeature` objects, which
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
extra:
|
||||
show_sources: True
|
||||
|
||||
Note that the *options* field contains fields which may be specific to a particular feature type - read the documentation below on each feature type for more information.
|
||||
|
||||
@@ -76,7 +78,8 @@ The InvenTree dashboard is a collection of "items" which are displayed on the ma
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -89,7 +92,8 @@ The *options* field in the returned `UIFeature` object can contain the following
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -110,7 +114,8 @@ Many of the pages in the InvenTree web interface are built using a series of "pa
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -123,7 +128,8 @@ The *options* field in the returned `UIFeature` object can contain the following
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -144,7 +150,8 @@ The `get_ui_template_editors` feature type can be used to provide custom templat
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -157,7 +164,8 @@ The `get_ui_template_previews` feature type can be used to provide custom templa
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ A custom plugin may implement the `validate_model_deletion` method to perform cu
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -40,7 +41,8 @@ Any plugin which inherits the `ValidationMixin` can implement the `validate_mode
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -113,7 +115,8 @@ If the custom method determines that the part name is *objectionable*, it should
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -126,7 +129,8 @@ Validation of the Part IPN (Internal Part Number) field is exposed to custom plu
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -139,7 +143,8 @@ Validation of the Part IPN (Internal Part Number) field is exposed to custom plu
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -156,7 +161,8 @@ The `validate_batch_code` method allows plugins to raise an error if a batch cod
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -169,7 +175,8 @@ The `generate_batch_code` method can be implemented to generate a new batch code
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -188,7 +195,8 @@ Custom serial number validation can be implemented using the `validate_serial_nu
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -227,7 +235,8 @@ A custom plugin can implement the `convert_serial_to_int` method to determine ho
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
@@ -245,7 +254,8 @@ For custom serial number schemes, it is important to provide a method to generat
|
||||
show_bases: False
|
||||
show_root_heading: False
|
||||
show_root_toc_entry: False
|
||||
show_sources: True
|
||||
extra:
|
||||
show_sources: True
|
||||
summary: False
|
||||
members: []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user