Docs refactor (#9545)

* Refactor / reognaize docs structure

* Refactor plugin docs structure

* More refactoring / cleanup

* Update build images

* Gallery updates

* Order images

* Update part docs

* Settings images

* Stock images

* Reitntroduce gallery

* Add custom icon macro

* Update icons

* Cleanup

* Fix link

* Fix internal links

* Revert some page moves

* Fix links

* Fix links
This commit is contained in:
Oliver
2025-04-22 08:18:32 +10:00
committed by GitHub
parent 9b489911e5
commit 6b08e45eac
240 changed files with 964 additions and 831 deletions
+41 -41
View File
@@ -47,18 +47,18 @@ Templates (whether for generating [reports](./report.md) or [labels](./labels.md
| Model Type | Description |
| --- | --- |
| [build](#build-order) | A [Build Order](../build/build.md) instance |
| [buildline](#build-line) | A [Build Order Line Item](../build/build.md) instance |
| [salesorder](#sales-order) | A [Sales Order](../order/sales_order.md) instance |
| [returnorder](#return-order) | A [Return Order](../order/return_order.md) instance |
| [purchaseorder](#purchase-order) | A [Purchase Order](../order/purchase_order.md) instance |
| [stockitem](#stock-item) | A [StockItem](../stock/stock.md#stock-item) instance |
| [stocklocation](#stock-location) | A [StockLocation](../stock/stock.md#stock-location) instance |
| [part](#part) | A [Part](../part/part.md) instance |
| [build](#build-order) | A [Build Order](../manufacturing/build.md) instance |
| [buildline](#build-line) | A [Build Order Line Item](../manufacturing/build.md) instance |
| [salesorder](#sales-order) | A [Sales Order](../sales/sales_order.md) instance |
| [returnorder](#return-order) | A [Return Order](../sales/return_order.md) instance |
| [purchaseorder](#purchase-order) | A [Purchase Order](../purchasing/purchase_order.md) instance |
| [stockitem](#stock-item) | A [StockItem](../stock/index.md#stock-item) instance |
| [stocklocation](#stock-location) | A [StockLocation](../stock/index.md#stock-location) instance |
| [part](#part) | A [Part](../part/index.md) instance |
### Build Order
When printing a report or label against a [Build Order](../build/build.md) object, the following context variables are available:
When printing a report or label against a [Build Order](../manufacturing/build.md) object, the following context variables are available:
{{ report_context("models", "build") }}
@@ -68,7 +68,7 @@ When printing a report or label against a [Build Order](../build/build.md) objec
### Build Line
When printing a report or label against a [BuildOrderLineItem](../build/build.md) object, the following context variables are available:
When printing a report or label against a [BuildOrderLineItem](../manufacturing/build.md) object, the following context variables are available:
{{ report_context("models", "buildline") }}
@@ -78,7 +78,7 @@ When printing a report or label against a [BuildOrderLineItem](../build/build.md
### Sales Order
When printing a report or label against a [SalesOrder](../order/sales_order.md) object, the following context variables are available:
When printing a report or label against a [SalesOrder](../sales/sales_order.md) object, the following context variables are available:
{{ report_context("models", "salesorder") }}
@@ -88,7 +88,7 @@ When printing a report or label against a [SalesOrder](../order/sales_order.md)
### Sales Order Shipment
When printing a report or label against a [SalesOrderShipment](../order/sales_order.md#sales-order-shipments) object, the following context variables are available:
When printing a report or label against a [SalesOrderShipment](../sales/sales_order.md#sales-order-shipments) object, the following context variables are available:
{{ report_context("models", "salesordershipment") }}
@@ -98,19 +98,19 @@ When printing a report or label against a [SalesOrderShipment](../order/sales_or
### Return Order
When printing a report or label against a [ReturnOrder](../order/return_order.md) object, the following context variables are available:
When printing a report or label against a [ReturnOrder](../sales/return_order.md) object, the following context variables are available:
{{ report_context("models", "returnorder") }}
### Purchase Order
When printing a report or label against a [PurchaseOrder](../order/purchase_order.md) object, the following context variables are available:
When printing a report or label against a [PurchaseOrder](../purchasing/purchase_order.md) object, the following context variables are available:
{{ report_context("models", "purchaseorder") }}
### Stock Item
When printing a report or label against a [StockItem](../stock/stock.md#stock-item) object, the following context variables are available:
When printing a report or label against a [StockItem](../stock/index.md#stock-item) object, the following context variables are available:
{{ report_context("models", "stockitem") }}
@@ -120,7 +120,7 @@ When printing a report or label against a [StockItem](../stock/stock.md#stock-it
### Stock Location
When printing a report or label against a [StockLocation](../stock/stock.md#stock-location) object, the following context variables are available:
When printing a report or label against a [StockLocation](../stock/index.md#stock-location) object, the following context variables are available:
{{ report_context("models", "stocklocation") }}
@@ -130,7 +130,7 @@ When printing a report or label against a [StockLocation](../stock/stock.md#stoc
### Part
When printing a report or label against a [Part](../part/part.md) object, the following context variables are available:
When printing a report or label against a [Part](../part/index.md) object, the following context variables are available:
{{ report_context("models", "part") }}
@@ -155,7 +155,7 @@ Each part object has access to a lot of context variables about the part. The fo
| name | Brief name for this part |
| full_name | Full name for this part (including IPN, if not null and including variant, if not null) |
| variant | Optional variant number for this part - Must be unique for the part name
| category | The [PartCategory](./context_variables.md#part-category) object to which this part belongs
| category | The [PartCategory](#part-category) object to which this part belongs
| description | Longer form description of the part
| keywords | Optional keywords for improving part search results
| IPN | Internal part number (optional)
@@ -163,8 +163,8 @@ Each part object has access to a lot of context variables about the part. The fo
| is_template | If True, this part is a 'template' part
| link | Link to an external page with more information about this part (e.g. internal Wiki)
| image | Image of this part
| default_location | The default [StockLocation](./context_variables.md#stocklocation) object where the item is normally stored (may be null)
| default_supplier | The default [SupplierPart](./context_variables.md#supplierpart) which should be used to procure and stock this part
| default_location | The default [StockLocation](#stock-location) object where the item is normally stored (may be null)
| default_supplier | The default [SupplierPart](#supplierpart) which should be used to procure and stock this part
| default_expiry | The default expiry duration for any StockItem instances of this part
| minimum_stock | Minimum preferred quantity to keep in stock
| units | Units of measure for this part (default='pcs')
@@ -200,7 +200,7 @@ Each part object has access to a lot of context variables about the part. The fo
|----------|-------------|
| name | Name of this category |
| parent | Parent category |
| default_location | Default [StockLocation](./context_variables.md#stocklocation) object for parts in this category or child categories |
| default_location | Default [StockLocation](#stock-location) object for parts in this category or child categories |
| default_keywords | Default keywords for parts created in this category |
### Stock
@@ -210,37 +210,37 @@ Each part object has access to a lot of context variables about the part. The fo
| Variable | Description |
|----------|-------------|
| parent | Link to another [StockItem](./context_variables.md#stockitem) from which this StockItem was created |
| parent | Link to another [StockItem](#stock-item) from which this StockItem was created |
| uid | Field containing a unique-id which is mapped to a third-party identifier (e.g. a barcode) |
| part | Link to the master abstract [Part](./context_variables.md#part) that this [StockItem](./context_variables.md#stockitem) is an instance of |
| supplier_part | Link to a specific [SupplierPart](./context_variables.md#supplierpart) (optional) |
| location | The [StockLocation](./context_variables.md#stocklocation) Where this [StockItem](./context_variables.md#stockitem) is located |
| part | Link to the master abstract [Part](#part) that this [StockItem](#stock-item) is an instance of |
| supplier_part | Link to a specific [SupplierPart](#supplierpart) (optional) |
| location | The [StockLocation](#stock-location) Where this [StockItem](#stock-item) is located |
| quantity | Number of stocked units |
| batch | Batch number for this [StockItem](./context_variables.md#stockitem) |
| serial | Unique serial number for this [StockItem](./context_variables.md#stockitem) |
| batch | Batch number for this [StockItem](#stock-item) |
| serial | Unique serial number for this [StockItem](#stock-item) |
| link | Optional URL to link to external resource |
| updated | Date that this stock item was last updated (auto) |
| expiry_date | Expiry date of the [StockItem](./context_variables.md#stockitem) (optional) |
| expiry_date | Expiry date of the [StockItem](#stock-item) (optional) |
| stocktake_date | Date of last stocktake for this item |
| stocktake_user | User that performed the most recent stocktake |
| review_needed | Flag if [StockItem](./context_variables.md#stockitem) needs review |
| delete_on_deplete | If True, [StockItem](./context_variables.md#stockitem) will be deleted when the stock level gets to zero |
| status | Status of this [StockItem](./context_variables.md#stockitem) (ref: InvenTree.status_codes.StockStatus) |
| review_needed | Flag if [StockItem](#stock-item) needs review |
| delete_on_deplete | If True, [StockItem](#stock-item) will be deleted when the stock level gets to zero |
| status | Status of this [StockItem](#stock-item) (ref: InvenTree.status_codes.StockStatus) |
| status_label | Textual representation of the status e.g. "OK" |
| notes | Extra notes field |
| build | Link to a Build (if this stock item was created from a build) |
| is_building | Boolean field indicating if this stock item is currently being built (or is "in production") |
| purchase_order | Link to a [PurchaseOrder](./context_variables.md#purchase-order) (if this stock item was created from a PurchaseOrder) |
| infinite | If True this [StockItem](./context_variables.md#stockitem) can never be exhausted |
| sales_order | Link to a [SalesOrder](./context_variables.md#salesorder) object (if the StockItem has been assigned to a SalesOrder) |
| purchase_price | The unit purchase price for this [StockItem](./context_variables.md#stockitem) - this is the unit price at time of purchase (if this item was purchased from an external supplier) |
| purchase_order | Link to a [PurchaseOrder](#purchase-order) (if this stock item was created from a PurchaseOrder) |
| infinite | If True this [StockItem](#stock-item) can never be exhausted |
| sales_order | Link to a [SalesOrder](#sales-order) object (if the StockItem has been assigned to a SalesOrder) |
| purchase_price | The unit purchase price for this [StockItem](#stock-item) - this is the unit price at time of purchase (if this item was purchased from an external supplier) |
| packaging | Description of how the StockItem is packaged (e.g. "reel", "loose", "tape" etc) |
#### StockLocation
| Variable | Description |
|----------|-------------|
| barcode | Brief payload data (e.g. for labels). Example: {"stocklocation": 826} where 826 is the primary key|
| barcode | Brief payload data (e.g. for labels). Example: `{"stocklocation": 826}` where 826 is the primary key|
| description | The description of the location |
| icon | The name of the icon if set, e.g. fas fa-warehouse |
| item_count | Simply returns the number of stock items in this location |
@@ -261,7 +261,7 @@ Each part object has access to a lot of context variables about the part. The fo
| name | Name of the company |
| description | Longer form description |
| website | URL for the company website |
| primary_address | [Address](./context_variables.md#address) object that is marked as primary address |
| primary_address | [Address](#address) object that is marked as primary address |
| address | String format of the primary address |
| contact | Contact Name |
| phone | Contact phone number |
@@ -301,8 +301,8 @@ Each part object has access to a lot of context variables about the part. The fo
| Variable | Description |
|----------|-------------|
| part | Link to the master Part (Obsolete) |
| source_item | The sourcing [StockItem](./context_variables.md#stockitem) linked to this [SupplierPart](./context_variables.md#supplierpart) instance |
| supplier | [Company](./context_variables.md#company) that supplies this part |
| source_item | The sourcing [StockItem](#stock-item) linked to this [SupplierPart](#supplierpart) instance |
| supplier | [Company](#company) that supplies this part |
| SKU | Stock keeping unit (supplier part number) |
| link | Link to external website for this supplier part |
| description | Descriptive notes field |
@@ -314,8 +314,8 @@ Each part object has access to a lot of context variables about the part. The fo
| pretty_name | The IPN, supplier name, supplier SKU and (if not null) manufacturer string joined by `|`. Ex. `P00037 | Company | 000021` |
| unit_pricing | The price for one unit. |
| price_breaks | Return the associated price breaks in the correct order |
| has_price_breaks | Whether this [SupplierPart](./context_variables.md#supplierpart) has price breaks |
| manufacturer_string | Format a MPN string for this [SupplierPart](./context_variables.md#supplierpart). Concatenates manufacture name and part number. |
| has_price_breaks | Whether this [SupplierPart](#supplierpart) has price breaks |
| manufacturer_string | Format a MPN string for this [SupplierPart](#supplierpart). Concatenates manufacture name and part number. |
### User
+3 -3
View File
@@ -148,7 +148,7 @@ Generate a list of all active customers:
### Advanced Database Queries
More advanced database filtering should be achieved using a [report plugin](../extend/plugins/report.md), and adding custom context data to the report template.
More advanced database filtering should be achieved using a [report plugin](../plugins/mixins/report.md), and adding custom context data to the report template.
## Number Formatting
@@ -466,7 +466,7 @@ If you have a custom logo, but explicitly wish to load the InvenTree logo itself
## Report Assets
[Report Assets](./templates.md#report-assets) are files specifically uploaded by the user for inclusion in generated reports and labels.
[Report Assets](./index.md#report-assets) are files specifically uploaded by the user for inclusion in generated reports and labels.
You can add asset images to the reports and labels by using the `{% raw %}{% asset ... %}{% endraw %}` template tag:
@@ -489,7 +489,7 @@ If you need to load a part parameter for a particular Part, within the context o
### Example
The following example assumes that you have a report or label which contains a valid [Part](../part/part.md) instance:
The following example assumes that you have a report or label which contains a valid [Part](../part/index.md) instance:
```
{% raw %}
@@ -43,7 +43,7 @@ InvenTree is supplied with a number of default templates "out of the box" - for
### Extending with Plugins
The [ReportMixin plugin class](../extend/plugins/report.md) allows reporting functionality to be extended with custom features.
The [ReportMixin plugin class](../plugins/mixins/report.md) allows reporting functionality to be extended with custom features.
## WeasyPrint Template Rendering
@@ -82,7 +82,7 @@ Boolean field which determines if the specific report template is enabled, and a
The filename pattern used to generate the output `.pdf` file. Defaults to "report.pdf".
The filename pattern allows custom rendering with any context variables which are available to the report. For example, a test report for a particular [Stock Item](../stock/stock.md#stock-item) can use the part name and serial number of the stock item when generating the report name:
The filename pattern allows custom rendering with any context variables which are available to the report. For example, a test report for a particular [Stock Item](../stock/index.md#stock-item) can use the part name and serial number of the stock item when generating the report name:
{% with id="report-filename-pattern", url="report/filename_pattern.png", description="Report filename pattern" %}
{% include 'img.html' %}
@@ -93,7 +93,7 @@ The filename pattern allows custom rendering with any context variables which ar
Each template instance provides a *filters* field, which can be used to filter which items a report or label template can be generated against. The target of the *filters* field depends on the model type associated with the particular template.
As an example, let's say that a certain `StockItem` report should only be generated for "trackable" stock items. A filter could easily be constructed to accommodate this, by limiting available items to those where the associated [Part](../part/part.md) is *trackable*:
As an example, let's say that a certain `StockItem` report should only be generated for "trackable" stock items. A filter could easily be constructed to accommodate this, by limiting available items to those where the associated [Part](../part/index.md) is *trackable*:
{% with id="report-filter-valid", url="report/filters_valid.png", description="Report filter selection" %}
{% include 'img.html' %}
@@ -110,7 +110,7 @@ If you enter an invalid option for the filter field, an error message will be di
### Metadata
A JSON field made available to any [plugins](../extend/plugins.md) - but not used by internal code.
A JSON field made available to any [plugins](../plugins/index.md) - but not used by internal code.
## Reporting Options
+12 -12
View File
@@ -14,14 +14,14 @@ The following report templates are provided "out of the box" and can be used as
| Template | Model Type | Description |
| --- | --- | --- |
| [Bill of Materials](#bill-of-materials-report) | [Part](../part/part.md) | Bill of Materials report |
| [Build Order](#build-order) | [BuildOrder](../build/build.md) | Build Order report |
| [Purchase Order](#purchase-order) | [PurchaseOrder](../order/purchase_order.md) | Purchase Order report |
| [Return Order](#return-order) | [ReturnOrder](../order/return_order.md) | Return Order report |
| [Sales Order](#sales-order) | [SalesOrder](../order/sales_order.md) | Sales Order report |
| [Sales Order Shipment](#sales-order-shipment) | [SalesOrderShipment](../order/sales_order.md) | Sales Order Shipment report |
| [Stock Location](#stock-location) | [StockLocation](../stock/stock.md#stock-location) | Stock Location report |
| [Test Report](#test-report) | [StockItem](../stock/stock.md#stock-item) | Test Report |
| [Bill of Materials](#bill-of-materials-report) | [Part](../part/index.md) | Bill of Materials report |
| [Build Order](#build-order) | [BuildOrder](../manufacturing/build.md) | Build Order report |
| [Purchase Order](#purchase-order) | [PurchaseOrder](../purchasing/purchase_order.md) | Purchase Order report |
| [Return Order](#return-order) | [ReturnOrder](../sales/return_order.md) | Return Order report |
| [Sales Order](#sales-order) | [SalesOrder](../sales/sales_order.md) | Sales Order report |
| [Sales Order Shipment](#sales-order-shipment) | [SalesOrderShipment](../sales/sales_order.md) | Sales Order Shipment report |
| [Stock Location](#stock-location) | [StockLocation](../stock/index.md#stock-location) | Stock Location report |
| [Test Report](#test-report) | [StockItem](../stock/index.md#stock-item) | Test Report |
### Bill of Materials Report
@@ -61,10 +61,10 @@ The following label templates are provided "out of the box" and can be used as a
| Template | Model Type | Description |
| --- | --- | --- |
| [Build Line](#build-line-label) | [Build line item](../build/build.md) | Build Line label |
| [Part](#part-label) | [Part](../part/part.md) | Part label |
| [Stock Item](#stock-item-label) | [StockItem](../stock/stock.md#stock-item) | Stock Item label |
| [Stock Location](#stock-location-label) | [StockLocation](../stock/stock.md#stock-location) | Stock Location label |
| [Build Line](#build-line-label) | [Build line item](../manufacturing/build.md) | Build Line label |
| [Part](#part-label) | [Part](../part/index.md) | Part label |
| [Stock Item](#stock-item-label) | [StockItem](../stock/index.md#stock-item) | Stock Item label |
| [Stock Location](#stock-location-label) | [StockLocation](../stock/index.md#stock-location) | Stock Location label |
### Build Line Label