From fa258f3faedc2215bf632d2044f36113c0f810b8 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 21 May 2024 22:14:34 +1000 Subject: [PATCH 1/2] Update API level for "modern" report templates --- inventree/label.py | 2 +- inventree/report.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inventree/label.py b/inventree/label.py index e3d29c1d..5c662a5e 100644 --- a/inventree/label.py +++ b/inventree/label.py @@ -9,7 +9,7 @@ # The InvenTree API endpoint changed considerably @ version 197 # Ref: https://github.com/inventree/InvenTree/pull/7074 -MODERN_LABEL_PRINTING_API = 198 +MODERN_LABEL_PRINTING_API = 201 class LabelPrintingMixin: diff --git a/inventree/report.py b/inventree/report.py index aff9e6eb..e34e99f8 100644 --- a/inventree/report.py +++ b/inventree/report.py @@ -5,7 +5,7 @@ # The InvenTree API endpoint changed considerably @ version 197 # Ref: https://github.com/inventree/InvenTree/pull/7074 -MODERN_LABEL_PRINTING_API = 198 +MODERN_LABEL_PRINTING_API = 201 class ReportPrintingMixin: From 58a97678d14e9f7e8687d1a865c772f43db37653 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 7 Mar 2025 13:59:48 +1100 Subject: [PATCH 2/2] Adjust unit testing - Support new report printing API - Ref: https://github.com/inventree/InvenTree/pull/9096 --- test/test_report.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test_report.py b/test/test_report.py index 7f309d3f..691eacd9 100644 --- a/test/test_report.py +++ b/test/test_report.py @@ -51,9 +51,7 @@ def test_print_report(self): # Print the report response = build.printReport(template) - for key in ['pk', 'model_type', 'output', 'template']: + for key in ['pk', 'output']: self.assertIn(key, response) self.assertIsNotNone(response['output']) - self.assertEqual(response['template'], template.pk) - self.assertEqual(response['model_type'], build.getModelType())