2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

Cleanup old settings (#8709)

* Use LABEL_ENABLE and REPORT_ENABLE settings in PUI

* Cleanup base.html

- Should reduce db hits slightly

* Remove defunct homepage settings

* Cleanup old settings

* Adjust unit test
This commit is contained in:
Oliver
2024-12-19 07:31:59 +11:00
committed by GitHub
parent 1c9f56011c
commit e37e72357a
8 changed files with 18 additions and 177 deletions

View File

@ -253,20 +253,6 @@ SYSTEM_SETTINGS: dict[str, InvenTreeSettingsKeyType] = {
'validator': bool,
'default': True,
},
'INVENTREE_REQUIRE_CONFIRM': {
'name': _('Require confirm'),
'description': _('Require explicit user confirmation for certain action.'),
'validator': bool,
'default': True,
},
'INVENTREE_TREE_DEPTH': {
'name': _('Tree Depth'),
'description': _(
'Default tree depth for treeview. Deeper levels can be lazy loaded as they are needed.'
),
'default': 1,
'validator': [int, MinValueValidator(0)],
},
'INVENTREE_UPDATE_CHECK_INTERVAL': {
'name': _('Update Check Interval'),
'description': _('How often to check for updates (set to zero to disable)'),

View File

@ -19,120 +19,6 @@ def label_printer_options():
USER_SETTINGS: dict[str, InvenTreeSettingsKeyType] = {
'HOMEPAGE_HIDE_INACTIVE': {
'name': _('Hide inactive parts'),
'description': _('Hide inactive parts in results displayed on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_PART_STARRED': {
'name': _('Show subscribed parts'),
'description': _('Show subscribed parts on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_CATEGORY_STARRED': {
'name': _('Show subscribed categories'),
'description': _('Show subscribed part categories on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_PART_LATEST': {
'name': _('Show latest parts'),
'description': _('Show latest parts on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_BOM_REQUIRES_VALIDATION': {
'name': _('Show invalid BOMs'),
'description': _('Show BOMs that await validation on the homepage'),
'default': False,
'validator': bool,
},
'HOMEPAGE_STOCK_RECENT': {
'name': _('Show recent stock changes'),
'description': _('Show recently changed stock items on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_STOCK_LOW': {
'name': _('Show low stock'),
'description': _('Show low stock items on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_SHOW_STOCK_DEPLETED': {
'name': _('Show depleted stock'),
'description': _('Show depleted stock items on the homepage'),
'default': False,
'validator': bool,
},
'HOMEPAGE_BUILD_STOCK_NEEDED': {
'name': _('Show needed stock'),
'description': _('Show stock items needed for builds on the homepage'),
'default': False,
'validator': bool,
},
'HOMEPAGE_STOCK_EXPIRED': {
'name': _('Show expired stock'),
'description': _('Show expired stock items on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_STOCK_STALE': {
'name': _('Show stale stock'),
'description': _('Show stale stock items on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_BUILD_PENDING': {
'name': _('Show pending builds'),
'description': _('Show pending builds on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_BUILD_OVERDUE': {
'name': _('Show overdue builds'),
'description': _('Show overdue builds on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_PO_OUTSTANDING': {
'name': _('Show outstanding POs'),
'description': _('Show outstanding POs on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_PO_OVERDUE': {
'name': _('Show overdue POs'),
'description': _('Show overdue POs on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_SO_OUTSTANDING': {
'name': _('Show outstanding SOs'),
'description': _('Show outstanding SOs on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_SO_OVERDUE': {
'name': _('Show overdue SOs'),
'description': _('Show overdue SOs on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_SO_SHIPMENTS_PENDING': {
'name': _('Show pending SO shipments'),
'description': _('Show pending SO shipments on the homepage'),
'default': True,
'validator': bool,
},
'HOMEPAGE_NEWS': {
'name': _('Show News'),
'description': _('Show news on the homepage'),
'default': False,
'validator': bool,
},
'LABEL_INLINE': {
'name': _('Inline label display'),
'description': _(

View File

@ -628,7 +628,7 @@ class UserSettingsApiTest(InvenTreeAPITestCase):
def test_user_setting_init(self):
"""Test we can retrieve a setting which has not yet been initialized."""
key = 'HOMEPAGE_PART_LATEST'
key = 'LABEL_INLINE'
# Ensure it does not actually exist in the database
self.assertFalse(InvenTreeUserSetting.objects.filter(key=key).exists())

View File

@ -2,14 +2,8 @@
{% load i18n %}
{% load inventree_extras %}
{% plugins_enabled as plugins_enabled %}
{% settings_value 'BARCODE_ENABLE' as barcodes %}
{% settings_value 'RETURNORDER_ENABLED' as return_order_enabled %}
{% settings_value "REPORT_ENABLE" as report_enabled %}
{% settings_value "SERVER_RESTART_REQUIRED" as server_restart_required %}
{% settings_value "_PENDING_MIGRATIONS" as pending_migrations %}
{% settings_value "LABEL_ENABLE" as labels_enabled %}
{% inventree_show_about user as show_about %}
<!DOCTYPE html>
<html lang="en">