From 6d8620c42707de42f16bcaef9fdba35b5dcee0ff Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 28 Aug 2024 03:08:01 +0000 Subject: [PATCH] Remove REPORT_ENABLE_TEST_REPORT setting --- src/backend/InvenTree/common/models.py | 6 ------ src/backend/InvenTree/common/tests.py | 7 ------- src/backend/InvenTree/stock/templates/stock/item_base.html | 6 +----- .../InvenTree/templates/InvenTree/settings/report.html | 1 - src/frontend/src/pages/Index/Settings/SystemSettings.tsx | 3 +-- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/backend/InvenTree/common/models.py b/src/backend/InvenTree/common/models.py index 19756153e1..34f95ba3de 100644 --- a/src/backend/InvenTree/common/models.py +++ b/src/backend/InvenTree/common/models.py @@ -1704,12 +1704,6 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'default': 'A4', 'choices': report.helpers.report_page_size_options, }, - 'REPORT_ENABLE_TEST_REPORT': { - 'name': _('Enable Test Reports'), - 'description': _('Enable generation of test reports'), - 'default': True, - '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/common/tests.py b/src/backend/InvenTree/common/tests.py index 7acd3b9c9e..826bce15b7 100644 --- a/src/backend/InvenTree/common/tests.py +++ b/src/backend/InvenTree/common/tests.py @@ -228,9 +228,6 @@ class SettingsTest(InvenTreeTestCase): report_size_obj = InvenTreeSetting.get_setting_object( 'REPORT_DEFAULT_PAGE_SIZE' ) - report_test_obj = InvenTreeSetting.get_setting_object( - 'REPORT_ENABLE_TEST_REPORT' - ) # check settings base fields self.assertEqual(instance_obj.name, 'Server Instance Name') @@ -260,7 +257,6 @@ class SettingsTest(InvenTreeTestCase): # check setting_type self.assertEqual(instance_obj.setting_type(), 'string') - self.assertEqual(report_test_obj.setting_type(), 'boolean') self.assertEqual(stale_days.setting_type(), 'integer') # check as_int @@ -269,9 +265,6 @@ class SettingsTest(InvenTreeTestCase): instance_obj.as_int(), 'InvenTree' ) # not an int -> return default - # check as_bool - self.assertEqual(report_test_obj.as_bool(), True) - # check to_native_value self.assertEqual(stale_days.to_native_value(), 0) diff --git a/src/backend/InvenTree/stock/templates/stock/item_base.html b/src/backend/InvenTree/stock/templates/stock/item_base.html index 8550bc9419..05544a9ebb 100644 --- a/src/backend/InvenTree/stock/templates/stock/item_base.html +++ b/src/backend/InvenTree/stock/templates/stock/item_base.html @@ -54,19 +54,15 @@ {% endif %} -{% if test_report_enabled or labels_enabled %}
-{% endif %} {% if user_owns_item %} diff --git a/src/backend/InvenTree/templates/InvenTree/settings/report.html b/src/backend/InvenTree/templates/InvenTree/settings/report.html index 9d9cd96bf4..daaf66bdd0 100644 --- a/src/backend/InvenTree/templates/InvenTree/settings/report.html +++ b/src/backend/InvenTree/templates/InvenTree/settings/report.html @@ -18,7 +18,6 @@ {% include "InvenTree/settings/setting.html" with key="REPORT_DEFAULT_PAGE_SIZE" icon="fa-print" %} {% 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" %} diff --git a/src/frontend/src/pages/Index/Settings/SystemSettings.tsx b/src/frontend/src/pages/Index/Settings/SystemSettings.tsx index 6df4a606e7..1c32292526 100644 --- a/src/frontend/src/pages/Index/Settings/SystemSettings.tsx +++ b/src/frontend/src/pages/Index/Settings/SystemSettings.tsx @@ -161,8 +161,7 @@ export default function SystemSettings() { 'REPORT_ENABLE', 'REPORT_DEFAULT_PAGE_SIZE', 'REPORT_DEBUG_MODE', - 'REPORT_LOG_ERRORS', - 'REPORT_ENABLE_TEST_REPORT' + 'REPORT_LOG_ERRORS' ]} /> )