2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 18:15:40 +00:00

Extend ReportMixin class to support labels (#4678)

* Extend ReportMixin context to shim label templates also

* Update docs
This commit is contained in:
Oliver
2023-04-22 23:46:43 +10:00
committed by GitHub
parent 50cbaff76d
commit 8df207d8e1
3 changed files with 29 additions and 0 deletions

View File

@ -6,6 +6,14 @@ title: Report Mixin
The ReportMixin class provides a plugin with the ability to extend the functionality of custom [report templates](../../report/report.md). A plugin which implements the ReportMixin mixin class can add custom context data to a report template for rendering.
### Add Report Context
A plugin which implements the ReportMixin mixin can define the `add_report_context` method, allowing custom context data to be added to a report template at time of printing.
### Add Label Context
Additionally the `add_label_context` method, allowing custom context data to be added to a label template at time of printing.
### Example
A sample plugin which provides additional context data to the report templates can be found [in the InvenTree source code](https://github.com/inventree/InvenTree/blob/master/InvenTree/plugin/samples/integration/report_plugin_sample.py):