mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-04-28 13:46:54 +00:00
Merge pull request #136 from inventree/0.3.1
Add doc for new "installed_items" context
This commit is contained in:
commit
5474f578a0
@ -10,6 +10,10 @@ title: Release 0.4.0
|
|||||||
|
|
||||||
[#1811](https://github.com/inventree/InvenTree/pull/1811) provides dynamic loading of detail views via the left-hand navigation menu. This significantly improves perceived speed by the user, as the entire page does not have to be reloaded.
|
[#1811](https://github.com/inventree/InvenTree/pull/1811) provides dynamic loading of detail views via the left-hand navigation menu. This significantly improves perceived speed by the user, as the entire page does not have to be reloaded.
|
||||||
|
|
||||||
|
### Test Report
|
||||||
|
|
||||||
|
[#1842](https://github.com/inventree/InvenTree/pull/1842) adds "installed items" to the available context data for a StockItem TestReport template.
|
||||||
|
|
||||||
## Major Bug Fixes
|
## Major Bug Fixes
|
||||||
|
|
||||||
| Pull Request | Description |
|
| Pull Request | Description |
|
||||||
|
@ -35,6 +35,7 @@ In addition to the default report context variables, the following context varia
|
|||||||
| part | The Part of which the stock_item is an instance |
|
| part | The Part of which the stock_item is an instance |
|
||||||
| results | A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below) |
|
| results | A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below) |
|
||||||
| result_list | A list of each test result object |
|
| result_list | A list of each test result object |
|
||||||
|
| installed_items | A flattened list representing all `StockItem` objects which are *installed inside* the referenced `StockItem` object |
|
||||||
|
|
||||||
#### Results
|
#### Results
|
||||||
|
|
||||||
@ -53,3 +54,21 @@ Firmware Checksum: {% raw %}{{ results.firmwarechecksum.value }}.
|
|||||||
Uploaded by {{ results.firmwarechecksum.user }}{% endraw %}
|
Uploaded by {{ results.firmwarechecksum.user }}{% endraw %}
|
||||||
</p>
|
</p>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Installed Items
|
||||||
|
|
||||||
|
The *installed_items* context variable is a list of all `StockItem` instances which are installed inside the `StockItem` referenced by the report template. Each `StockItem` can be dereferenced as follows:
|
||||||
|
|
||||||
|
```html
|
||||||
|
{% raw %}
|
||||||
|
<table>
|
||||||
|
{% for sub_item in installed_items %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ sub_item.full_name }}</td>
|
||||||
|
<td>Serial Number: {{ sub_item.serial }}</td>
|
||||||
|
<td>Pass: {{ sub_item.passedAllRequiredTests }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
{% endraw %}
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user