diff --git a/docs/docs/extend/plugins/report.md b/docs/docs/extend/plugins/report.md index e72814d8b1..1d0dc0c727 100644 --- a/docs/docs/extend/plugins/report.md +++ b/docs/docs/extend/plugins/report.md @@ -41,7 +41,8 @@ class SampleReportPlugin(ReportMixin, InvenTreePlugin): """Some custom function which is not required for the plugin to function""" return random.randint(0, 100) - def add_report_context(self, instance, request, context): + def add_report_context(self, report_instance, model_instance, request, context): + """Add example content to the report instance""" # We can add any extra context data we want to the report @@ -53,7 +54,7 @@ class SampleReportPlugin(ReportMixin, InvenTreePlugin): context['random_int'] = self.some_custom_function() # We can also add extra data to the context which is specific to the report type - context['is_purchase_order'] = isinstance(instance, PurchaseOrderReport) + context['is_purchase_order'] = isinstance(report_instance, PurchaseOrderReport) # We can also use the 'request' object to add extra context data context['request_method'] = request.method