From d9fddf64f1f2261ee78d6bbdc2f2ff82617eb125 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 6 Oct 2021 22:22:20 +1100 Subject: [PATCH] Make this setting a per-user setting --- InvenTree/InvenTree/static/css/inventree.css | 5 +++-- InvenTree/common/models.py | 14 ++++++------ .../templates/InvenTree/settings/navbar.html | 6 +++++ .../templates/InvenTree/settings/part.html | 1 - .../InvenTree/settings/settings.html | 1 + .../InvenTree/settings/user_forms.html | 22 +++++++++++++++++++ .../js/translated/model_renderers.js | 2 +- 7 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 InvenTree/templates/InvenTree/settings/user_forms.html diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index d3f17074fa..71e518560b 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -244,8 +244,9 @@ .label-form { margin: 2px; - padding-left: 4px; - padding-right: 4px; + padding: 3px; + padding-left: 10px; + padding-right: 10px; border-radius: 5px; } diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index fd64e2a042..41bfa596ed 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -648,13 +648,6 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'validator': bool, }, - 'PART_SHOW_QUANTITY_IN_FORMS': { - 'name': _('Show Quantity in Forms'), - 'description': _('Display available part quantity in some forms'), - 'default': True, - 'validator': bool, - }, - 'PART_SHOW_IMPORT': { 'name': _('Show Import in Views'), 'description': _('Display the import wizard in some part views'), @@ -969,6 +962,13 @@ class InvenTreeUserSetting(BaseInvenTreeSetting): 'default': 10, 'validator': [int, MinValueValidator(1)] }, + + 'PART_SHOW_QUANTITY_IN_FORMS': { + 'name': _('Show Quantity in Forms'), + 'description': _('Display available part quantity in some forms'), + 'default': True, + 'validator': bool, + }, } class Meta: diff --git a/InvenTree/templates/InvenTree/settings/navbar.html b/InvenTree/templates/InvenTree/settings/navbar.html index ebf24bffb1..095e616f5d 100644 --- a/InvenTree/templates/InvenTree/settings/navbar.html +++ b/InvenTree/templates/InvenTree/settings/navbar.html @@ -42,6 +42,12 @@ +
  • + + {% trans "Forms" %} + +
  • +