diff --git a/docs/docs/api/schema.md b/docs/docs/api/schema.md index 5d4ac82a23..f4ce2837f3 100644 --- a/docs/docs/api/schema.md +++ b/docs/docs/api/schema.md @@ -7,7 +7,7 @@ The API schema as documented below is generated using the [drf-spectactular](htt ## API Version -This documentation is for API version: `339` +This documentation is for API version: `352` !!! tip "API Schema History" We track API schema changes, and provide a snapshot of each API schema version in the [API schema repository](https://github.com/inventree/schema/). diff --git a/docs/docs/report/context_variables.md b/docs/docs/report/context_variables.md index 670a26fea5..ddd8a8d8d0 100644 --- a/docs/docs/report/context_variables.md +++ b/docs/docs/report/context_variables.md @@ -23,6 +23,28 @@ In addition to the [global context](#global-context), all *report* templates hav {{ report_context("base", "report") }} +When using the `merge` context variable, the selected items are available in the `instances` list. {{ templatefile("report/inventree_stock_report_merge.html") }} shows a complete example. To access individual item attributes, you can either loop through the `instances` or access them by index like `instance.0.name`. + +Below is an example template that generates a single report for some selected parts. Each part occupies a row in the table + +```html +{% raw %} +
Name | +Description | +
---|---|
{{ part.name }} | +{{ part.description }} | +
{{ item.part.description }}
+{{ item.stock_item.location }}
+Stock Item ID: {{ item.stock_item.pk }}
+
+ |
+ + {% if sub_item.serialized %} + {% trans "Serial" %}: {{ sub_item.serial }} + {% else %} + {% trans "Quantity" %}: {% decimal sub_item.quantity %} + {% endif %} + | +