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

Just added allocated_stock to the build report (#401)

* started python API reference guide

* Added test to the API reference guide

* Added Price break

* added context variables to the build section

* Cleand up build section and added new example

* Fine tuning

* fixed picture

* removed unfinished python reference guide

* Added allocated_stock to the build rreport
This commit is contained in:
Michael 2022-12-09 01:27:48 +01:00 committed by GitHub
parent 228828bd42
commit 24aef86eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,7 @@ The following variables are accessed by build.variable
| take_from | [StockLocation](./context_variables.md#stocklocation) to take stock from to make this build (if blank, can take from anywhere) | | take_from | [StockLocation](./context_variables.md#stocklocation) to take stock from to make this build (if blank, can take from anywhere) |
| title | The full name of the build | | title | The full name of the build |
| title | The description of the build | | title | The description of the build |
| allocated_stock.all | A query set with all allocated stock items for the build |
As usual items in a query sets can be selected by adding a .n to the set e.g. build.required_parts.0 As usual items in a query sets can be selected by adding a .n to the set e.g. build.required_parts.0
will result in the first part of the list. Each query set has again its own context variables. will result in the first part of the list. Each query set has again its own context variables.
@ -67,6 +68,14 @@ will result in the first part of the list. Each query set has again its own cont
| .sub_part | The part at this position | | .sub_part | The part at this position |
| .substitutes.all | A query set with all allowed substitutes for that part | | .substitutes.all | A query set with all allowed substitutes for that part |
#### allocated_stock.all
| Variable | Description |
| --- | --- |
| .bom_item | The bom item where this part belongs to |
| .stock_item | The allocated [StockItem](./context_variables.md#stockitem) |
### Example ### Example
The following example will create a report with header and BOM. In the BOM table substitutes will be listed. The following example will create a report with header and BOM. In the BOM table substitutes will be listed.