2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 13:46:54 +00:00

Add documentation for part labels

This commit is contained in:
Oliver 2021-07-21 22:15:46 +10:00
parent a373bc8326
commit 65d22502d5

View File

@ -184,7 +184,6 @@ To extend this template in a custom uploaded label, simply extend as follows:
{% endraw %}
```
## Stock Item Labels
Stock Item label templates are used to generate labels for individual Stock Items.
@ -224,6 +223,7 @@ The following variables are made available to the StockItem label template:
| serial | The `serial` field of the StockItem object |
| uid | The `uid` field of the StockItem object |
| tests | Dict object of TestResult data associated with the StockItem |
| parameters | Dict object containing the parameters associated with the base Part |
### URL-style QR code
@ -260,3 +260,47 @@ The following variables are made available to the StockLocation label template:
| Variable | Description |
| -------- | ----------- |
| location | The StockLocation object itself |
## Part Labels
Part label templates are used to generate labels for individual Part instances.
### Creating Part Label Templates
Part label templates are added (and edited) via the admin interface.
### Printing Part Labels
Part label can be printed using the following approaches:
To print a single part label from the Part detail view, select the *Print Label* option.
To print multiple part labels, select multiple parts in the part table and select the *Print Labels* option.
### Context Data
The following context variables are made available to the Part label template:
| Variable | Description |
| -------- | ----------- |
| part | The part object |
| category | The PartCategory which contains the Part |
| name | The name of the part |
| description | The description text for the part |
| IPN | Internal part number (IPN) for the part |
| revision | Part revision code |
| qr_data | String data which can be rendered to a QR code |
| parameters | Map (Python dictionary) object containing the parameters associated with the part instance |
#### Parameters
The part parameters can be accessed by parameter name lookup in the template, as follows:
```html
{% raw %}
Part: {{ part.name }}
Length: {{ parameters.length }}
{% endraw %}
```