Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 148e2bf

Browse files
Updates for 0.11.0 (#468)
* Add release entry for 0.11.x * Add note about default reports. * Add brief documentation on report filtering * Add images for report filter selection * More report docs * Cleanup * Fix filter docs for TestReport * Update context variables for TestReport * Add context variable information for purchase order * Updates for sales order report docs
1 parent 7ced6ad commit 148e2bf

File tree

11 files changed

+110
-17
lines changed

11 files changed

+110
-17
lines changed
43.5 KB
Loading
62.1 KB
Loading
9.74 KB
Loading
24.4 KB
Loading

docs/releases/release_notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Specific tagged releases are shown below. Click on the release notes for each ve
2727
!!! info "Release Notes"
2828
Starting from v0.7.2, release notes have been migrated to GitHub. Release notes for older versions are available at the links below.
2929

30+
### 0.11.x
31+
{% with prefix="0.11" %}{% include "release_table.html" %}{% endwith %}
32+
3033
### 0.10.x
3134
{% with prefix="0.10" %}{% include "release_table.html" %}{% endwith %}
3235

docs/report/build.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ title: Build Order Report
44

55
## Build Order Report
66

7-
Custom build order reports may be generated against any given Build Order. For example, build order reports can be used to generate work orders.
7+
Custom build order reports may be generated against any given [Build Order](../build/build.md). For example, build order reports can be used to generate work orders.
8+
9+
### Build Filters
10+
11+
A build order report template may define a set of filters against which [Build Order](../build/build.md) items are sorted.
812

913
### Context Variables
1014

docs/report/purchase_order.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,24 @@ title: Purchase Order Report
44

55
## Purchase Order Reports
66

7+
Custom purchase order reports may be generated against any given [Purchase Order](../buy/po.md). For example, purchase order reports could be used to generate a pdf of the order to send to a supplier.
8+
9+
### Purchase Order Filters
10+
11+
The report template can be filtered against available [Purchase Order](../buy/po.md) instances.
12+
713
### Context Variables
814

9-
!!! missing "TODO"
10-
This section requires further work
15+
In addition to the default report context variables, the following variables are made available to the purchase order report template for rendering:
16+
17+
| Variable | Description |
18+
| --- | --- |
19+
| order | The specific Purchase Order object |
20+
| reference | The order reference field (can also be accessed as `{% raw %}{{ order.description }}{% endraw %}`) |
21+
| description | The order description field |
22+
| supplier | The [supplier](../buy/supplier.md) associated with this purchase order |
23+
| lines | A list of available line items for this order |
24+
| extra_lines | A list of available *extra* line items for this order |
1125

1226
### Default Report Template
1327

docs/report/report.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,62 @@ InvenTree supports the following reporting functionality:
146146
| [Sales Order Report](./sales_order.md) | Format a sales order report |
147147
| [Return Order Report](./return_order.md) | Format a return order report |
148148
149+
### Default Reports
150+
151+
InvenTree is supplied with a number of default templates "out of the box". These are generally quite simple, but serve as a starting point for building custom reports to suit a specific need.
152+
153+
!!! tip "Read the Source"
154+
The source code for the default reports is [available on GitHub](https://github.com/inventree/InvenTree/tree/master/InvenTree/report/templates/report). Use this as a guide for generating your own reports!
155+
156+
## Creating Reports
157+
158+
Report templates are created (and edited) via the [admin interface](../settings/admin.md), under the *Report* section. Select the certain type of report template you are wanting to create, and press the *Add* button in the top right corner:
159+
160+
{% with id="report-create", url="report/add_report_template.png", description="Create new report" %}
161+
{% include 'img.html' %}
162+
{% endwith %}
163+
164+
!!! tip "Staff Access Only"
165+
Only users with staff access can upload or edit report template files.
166+
167+
!!! info "Editing Reports"
168+
Existing reports can be edited from the admin interface, in the same location as described above. To change the contents of the template, re-upload a template file, to overrie the existing template data.
169+
170+
### Name and Description
171+
172+
Each report template requires a name and description, which identify and describe the report template.
173+
174+
### Enabled Status
175+
176+
Boolean field which determines if the specific report template is enabled, and available for use. Reports can be disabled to remove them from the list of available templates, but without deleting them from the database.
177+
178+
### Filename Pattern
179+
180+
The filename pattern used to generate the output `.pdf` file. Defaults to "report.pdf"
181+
182+
### Report Filters
183+
184+
Each type of report provides a *filters* field, which can be used to filter which items a report can be generated against. The target of the *filters* field depends on the type of report - refer to the documentation on the specific report type for more information.
185+
186+
For example, the [Test Report](./test.md) filter targets the linked [Stock Item](../stock/status.md) object, and can be used to select which stock items are allowed for the given report. Let's say that a certain test 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*:
187+
188+
{% with id="report-filter-valid", url="report/filters_valid.png", description="Report filter selection" %}
189+
{% include 'img.html' %}
190+
{% endwith %}
191+
192+
If you enter an invalid option for the filter field, an error message will be displayed:
193+
194+
{% with id="report-filter-invalid", url="report/filters_invalid.png", description="Invalid filter selection" %}
195+
{% include 'img.html' %}
196+
{% endwith %}
197+
198+
!!! warning "Advanced Users"
199+
Report filtering is an advanced topic, and requires a little bit of knowledge of the underlying data structure!
200+
201+
### Metadata
202+
203+
A JSON field made available to any [plugins](../extend/plugins.md) - but not used by internal code.
204+
149205
## Report Options
150206
151207
A number of global reporting options are available for customizing InvenTree reports:
@@ -175,10 +231,6 @@ Setting the *Debug Mode* option renders the template as raw HTML instead of PDF,
175231
!!! warning "HTML Rendering Limitations"
176232
When rendered in debug mode, @page attributes (such as size, etc) will **not** be observed. Additionally, any asset files stored on the InvenTree server will not be rendered. Debug mode is not intended to produce "good looking" documents!
177233
178-
## Uploading Templates
179-
180-
Custom report templates can be uploaded using the [Admin Interface](../settings/admin.md). Only users with admin access can upload and/or edit report template files.
181-
182234
## Report Assets
183235
184236
User can upload asset files (e.g. images) which can be used when generating reports. For example, you may wish to generate a report with your company logo in the header. Asset files are uploaded via the admin interface.

docs/report/sales_order.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,24 @@ title: Sales Order Reports
44

55
## Sales Order Reports
66

7+
Custom sales order reports may be generated against any given [Sales Order](../sell/so.md). For example, a sales order report could be used to generate an invoice to send to a customer.
8+
9+
### Sales Order Filters
10+
11+
The report template can be filtered against available [Sales Order](../sell/so.md) instances.
12+
713
### Context Variables
814

9-
!!! missing "TODO"
10-
This section requires further work
15+
In addition to the default report context variables, the following variables are made available to the sales order report template for rendering:
16+
17+
| Variable | Description |
18+
| --- | --- |
19+
| order | The specific Sales Order object |
20+
| reference | The order reference field (can also be accessed as `{% raw %}{{ order.description }}{% endraw %}`) |
21+
| description | The order description field |
22+
| customer | The [customer](../sell/customer.md) associated with the particular sales order |
23+
| lines | A list of available line items for this order |
24+
| extra_lines | A list of available *extra* line items for this order |
1125

1226
### Default Report Template
1327

docs/report/test.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,35 @@ Custom test reports may be generated against any given stock item. All testing d
1010

1111
For example, an "Acceptance Test" report template may be customized to the particular device, with the results for certain tests rendering in a particular part of the page, with any tests which have not passed highlighted.
1212

13-
### Part Filters
13+
### Stock Item Filters
1414

15-
A TestReport template may define a set of filters against which parts are sorted. Any Part objects which match the provided filters can use the given TestReport.
15+
A TestReport template may define a set of filters against which stock items are sorted. Any [StockItem](../stock/stock.md) objects which match the provided filters can use the given TestReport.
1616

17-
This allows each TestReport to easily be assigned to a particular Part, or even multiple parts.
17+
This allows each TestReport to easily be assigned to a particular StockItem, or even multiple items.
1818

19-
In the example below, a test report template is uploaded and assigned to the part with the name *"My Widget"*. Any combination of fields relevant to the Part model can be used here.
19+
In the example below, a test report template is uploaded and available to any stock items linked to a part with the name *"My Widget"*. Any combination of fields relevant to the StockItem model can be used here.
2020

21-
{% with id="test_report_add", url="admin/test_report_add.png", description="Upload test report template" %}
21+
{% with id="test-report-filters", url="report/test_report_filters.png", description="Test report filters" %}
2222
{% include 'img.html' %}
2323
{% endwith %}
2424

25+
2526
### Context Variables
2627

2728
In addition to the default report context variables, the following context variables are made available to the TestReport template for rendering:
2829

2930
| Variable | Description |
3031
| --- | --- |
31-
| stock_item | The individual [StockItem](./context_variables.md#stockitem) object for which this test report is being generated |
32+
| stock_item | The individual [Stock Item](./context_variables.md#stockitem) object for which this test report is being generated |
33+
| serial | The serial number of the linked Stock Item |
3234
| part | The [Part](./context_variables.md#part) object of which the stock_item is an instance |
35+
| parameters | A dict object representing the [parameters](../part/parameter.md) of the referenced part |
36+
| test_keys | A list of the available 'keys' for the test results recorded against the stock item |
37+
| test_template_list | A list of the available [test templates](../part/test.md#part-test-templates) for the referenced part |
38+
| test_template_map | A map / dict of the available test templates |
3339
| results | A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below) |
3440
| result_list | A list of each test result object |
35-
| installed_items | A flattened list representing all [StockItem](./context_variables.md#stockitem) objects which are *installed inside* the referenced [StockItem](./context_variables.md#stockitem) object |
41+
| installed_items | A flattened list representing all [Stock Item](./context_variables.md#stockitem) objects which are *installed inside* the referenced [Stock Item](./context_variables.md#stockitem) object |
3642

3743
#### Results
3844

0 commit comments

Comments
 (0)