Add some more part options which set the default values for the following fields:

- Purchaseable
- Salable
- Trackable
This commit is contained in:
Oliver Walters 2020-11-09 20:26:19 +11:00
parent 826c471179
commit 8149759852
2 changed files with 26 additions and 0 deletions

View File

@ -85,6 +85,27 @@ class InvenTreeSetting(models.Model):
'validator': bool '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': { 'BUILDORDER_REFERENCE_PREFIX': {
'name': _('Build Order Reference Prefix'), 'name': _('Build Order Reference Prefix'),
'description': _('Prefix value for build order reference'), 'description': _('Prefix value for build order reference'),

View File

@ -11,9 +11,14 @@
{% block settings %} {% block settings %}
<h4>{% trans "Part Options" %}</h4>
<table class='table table-striped table-condensed'> <table class='table table-striped table-condensed'>
<thead></thead> <thead></thead>
<tbody> <tbody>
{% 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_IPN_REGEX" %}
{% include "InvenTree/settings/setting.html" with key="PART_COPY_BOM" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_BOM" %}
{% include "InvenTree/settings/setting.html" with key="PART_COPY_PARAMETERS" %} {% include "InvenTree/settings/setting.html" with key="PART_COPY_PARAMETERS" %}