From 0ee8560eff5349703d67c1862dcb4bedf68b17cc Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 28 Aug 2024 01:19:15 +0000 Subject: [PATCH] Remove references to old setting - Now offloaded to plugins --- src/backend/InvenTree/common/models.py | 8 -------- src/backend/InvenTree/report/tests.py | 18 ------------------ .../templates/InvenTree/settings/report.html | 1 - .../pages/Index/Settings/SystemSettings.tsx | 3 +-- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/backend/InvenTree/common/models.py b/src/backend/InvenTree/common/models.py index ac13e8d3c6..19756153e1 100644 --- a/src/backend/InvenTree/common/models.py +++ b/src/backend/InvenTree/common/models.py @@ -1710,14 +1710,6 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'default': True, 'validator': bool, }, - 'REPORT_ATTACH_TEST_REPORT': { - 'name': _('Attach Test Reports'), - 'description': _( - 'When printing a Test Report, attach a copy of the Test Report to the associated Stock Item' - ), - 'default': False, - 'validator': bool, - }, 'SERIAL_NUMBER_GLOBALLY_UNIQUE': { 'name': _('Globally Unique Serials'), 'description': _('Serial numbers for stock items must be globally unique'), diff --git a/src/backend/InvenTree/report/tests.py b/src/backend/InvenTree/report/tests.py index e534a3ab39..a5678dfb9d 100644 --- a/src/backend/InvenTree/report/tests.py +++ b/src/backend/InvenTree/report/tests.py @@ -580,24 +580,6 @@ class TestReportTest(PrintTestMixins, ReportTest): Attachment.objects.filter(model_id=item.pk, model_type='stockitem').exists() ) - return - # TODO @matmair - Re-add this test after https://github.com/inventree/InvenTree/pull/7074/files#r1600694356 is resolved - # Change the setting, now the test report should be attached automatically - InvenTreeSetting.set_setting('REPORT_ATTACH_TEST_REPORT', True, None) - - response = self.post( - url, {'template': template.pk, 'items': [item.pk]}, expected_code=201 - ) - - # There should be a link to the generated PDF - self.assertEqual(response.data['output'].startswith('/media/report/'), True) - - # Check that a report has been uploaded - attachment = Attachment.objects.filter( - model_id=item.pk, model_type='stockitem' - ).first() - self.assertIsNotNone(attachment) - def test_mdl_build(self): """Test the Build model.""" self.run_print_test(Build, 'build', label=False) diff --git a/src/backend/InvenTree/templates/InvenTree/settings/report.html b/src/backend/InvenTree/templates/InvenTree/settings/report.html index 6622befc36..9d9cd96bf4 100644 --- a/src/backend/InvenTree/templates/InvenTree/settings/report.html +++ b/src/backend/InvenTree/templates/InvenTree/settings/report.html @@ -19,7 +19,6 @@ {% include "InvenTree/settings/setting.html" with key="REPORT_DEBUG_MODE" icon="fa-laptop-code" %} {% include "InvenTree/settings/setting.html" with key="REPORT_LOG_ERRORS" icon="fa-exclamation-circle" %} {% include "InvenTree/settings/setting.html" with key="REPORT_ENABLE_TEST_REPORT" icon="fa-vial" %} - {% include "InvenTree/settings/setting.html" with key="REPORT_ATTACH_TEST_REPORT" icon="fa-file-upload" %} diff --git a/src/frontend/src/pages/Index/Settings/SystemSettings.tsx b/src/frontend/src/pages/Index/Settings/SystemSettings.tsx index fe4d7a49e4..6df4a606e7 100644 --- a/src/frontend/src/pages/Index/Settings/SystemSettings.tsx +++ b/src/frontend/src/pages/Index/Settings/SystemSettings.tsx @@ -162,8 +162,7 @@ export default function SystemSettings() { 'REPORT_DEFAULT_PAGE_SIZE', 'REPORT_DEBUG_MODE', 'REPORT_LOG_ERRORS', - 'REPORT_ENABLE_TEST_REPORT', - 'REPORT_ATTACH_TEST_REPORT' + 'REPORT_ENABLE_TEST_REPORT' ]} /> )