From 8149759852085df893ddcfa2755203a2f8f41ce5 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 9 Nov 2020 20:26:19 +1100 Subject: [PATCH] Add some more part options which set the default values for the following fields: - Purchaseable - Salable - Trackable --- InvenTree/common/models.py | 21 +++++++++++++++++++ .../templates/InvenTree/settings/part.html | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 0d3afbe226..2657804e37 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -85,6 +85,27 @@ class InvenTreeSetting(models.Model): 'validator': bool }, + 'PART_PURCHASEABLE': { + 'name': _('Purchaseable'), + 'description': _('Parts are purchaseable by default'), + 'default': False, + 'validator': bool, + }, + + 'PART_SALABLE': { + 'name': _('Salable'), + 'description': _('Parts are salable by default'), + 'default': False, + 'validator': bool, + }, + + 'PART_TRACKABLE': { + 'name': _('Trackable'), + 'description': _('Parts are trackable by default'), + 'default': False, + 'validator': bool, + }, + 'BUILDORDER_REFERENCE_PREFIX': { 'name': _('Build Order Reference Prefix'), 'description': _('Prefix value for build order reference'), diff --git a/InvenTree/templates/InvenTree/settings/part.html b/InvenTree/templates/InvenTree/settings/part.html index 19578ba858..6b83a62ef2 100644 --- a/InvenTree/templates/InvenTree/settings/part.html +++ b/InvenTree/templates/InvenTree/settings/part.html @@ -11,9 +11,14 @@ {% block settings %} +

{% trans "Part Options" %}

+ + {% include "InvenTree/settings/setting.html" with key="PART_PURCHASEABLE" %} + {% include "InvenTree/settings/setting.html" with key="PART_SALABLE" %} + {% include "InvenTree/settings/setting.html" with key="PART_TRACKABLE" %} {% include "InvenTree/settings/setting.html" with key="PART_IPN_REGEX" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_BOM" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_PARAMETERS" %}