mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #633 from SchrodingersGat/inventree-settings
Inventree settings
This commit is contained in:
commit
0939ffeb76
@ -6,6 +6,10 @@ from django.conf import settings
|
|||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
from common.models import InvenTreeSetting
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
def allowable_url_schemes():
|
def allowable_url_schemes():
|
||||||
""" Return the list of allowable URL schemes.
|
""" Return the list of allowable URL schemes.
|
||||||
@ -36,6 +40,18 @@ def validate_part_name(value):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def validate_part_ipn(value):
|
||||||
|
""" Validate the Part IPN against regex rule """
|
||||||
|
|
||||||
|
pattern = InvenTreeSetting.get_setting('part_ipn_regex')
|
||||||
|
|
||||||
|
if pattern:
|
||||||
|
match = re.search(pattern, value)
|
||||||
|
|
||||||
|
if match is None:
|
||||||
|
raise ValidationError(_('IPN must match regex pattern') + " '{pat}'".format(pat=pattern))
|
||||||
|
|
||||||
|
|
||||||
def validate_tree_name(value):
|
def validate_tree_name(value):
|
||||||
""" Prevent illegal characters in tree item names """
|
""" Prevent illegal characters in tree item names """
|
||||||
|
|
||||||
|
@ -1,5 +1,48 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.db.utils import OperationalError
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
class CommonConfig(AppConfig):
|
class CommonConfig(AppConfig):
|
||||||
name = 'common'
|
name = 'common'
|
||||||
|
|
||||||
|
def ready(self):
|
||||||
|
""" Will be called when the Common app is first loaded """
|
||||||
|
self.populate_default_settings()
|
||||||
|
|
||||||
|
def populate_default_settings(self):
|
||||||
|
""" Populate the default values for InvenTree key:value pairs.
|
||||||
|
If a setting does not exist, it will be created.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .models import InvenTreeSetting
|
||||||
|
|
||||||
|
here = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
settings_file = os.path.join(here, 'kvp.yaml')
|
||||||
|
|
||||||
|
with open(settings_file) as kvp:
|
||||||
|
values = yaml.safe_load(kvp)
|
||||||
|
|
||||||
|
for value in values:
|
||||||
|
key = value['key']
|
||||||
|
default = value['default']
|
||||||
|
description = value['description']
|
||||||
|
|
||||||
|
try:
|
||||||
|
# If a particular setting does not exist in the database, create it now
|
||||||
|
if not InvenTreeSetting.objects.filter(key=key).exists():
|
||||||
|
setting = InvenTreeSetting(
|
||||||
|
key=key,
|
||||||
|
value=default,
|
||||||
|
description=description
|
||||||
|
)
|
||||||
|
|
||||||
|
setting.save()
|
||||||
|
|
||||||
|
print("Creating new key: '{k}' = '{v}'".format(k=key, v=default))
|
||||||
|
except OperationalError:
|
||||||
|
# Migrations have not yet been applied - table does not exist
|
||||||
|
break
|
||||||
|
13
InvenTree/common/kvp.yaml
Normal file
13
InvenTree/common/kvp.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# This file contains the default values for the key:value settings available in InvenTree
|
||||||
|
# This file should not be edited locally.
|
||||||
|
|
||||||
|
# Note: The description strings provided here will be translatable,
|
||||||
|
# so ensure that any translations are provided as appropriate.
|
||||||
|
|
||||||
|
- key: 'part_ipn_regex'
|
||||||
|
default: ''
|
||||||
|
description: 'Format string for internal part number'
|
||||||
|
|
||||||
|
- key: part_deep_copy
|
||||||
|
default: True
|
||||||
|
description: 'Parts are deep-copied by default'
|
17
InvenTree/common/migrations/0006_auto_20200203_0951.py
Normal file
17
InvenTree/common/migrations/0006_auto_20200203_0951.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 2.2.9 on 2020-02-03 09:51
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('common', '0005_auto_20190915_1256'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='inventreesetting',
|
||||||
|
options={'verbose_name': 'InvenTree Setting', 'verbose_name_plural': 'InvenTree Settings'},
|
||||||
|
),
|
||||||
|
]
|
@ -21,6 +21,10 @@ class InvenTreeSetting(models.Model):
|
|||||||
even if that key does not exist.
|
even if that key does not exist.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "InvenTree Setting"
|
||||||
|
verbose_name_plural = "InvenTree Settings"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_setting(cls, key, backup_value=None):
|
def get_setting(cls, key, backup_value=None):
|
||||||
"""
|
"""
|
||||||
|
@ -6,7 +6,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-02-02 10:40+0000\n"
|
"POT-Creation-Date: 2020-02-03 10:28+0000\n"
|
||||||
"PO-Revision-Date: 2020-02-02 08:07+0100\n"
|
"PO-Revision-Date: 2020-02-02 08:07+0100\n"
|
||||||
"Last-Translator: Christian Schlüter <chschlue@gmail.com>\n"
|
"Last-Translator: Christian Schlüter <chschlue@gmail.com>\n"
|
||||||
"Language-Team: C <kde-i18n-doc@kde.org>\n"
|
"Language-Team: C <kde-i18n-doc@kde.org>\n"
|
||||||
@ -109,27 +109,35 @@ msgstr "Zerstört"
|
|||||||
msgid "Allocated"
|
msgid "Allocated"
|
||||||
msgstr "Zugeordnet"
|
msgstr "Zugeordnet"
|
||||||
|
|
||||||
#: InvenTree/validators.py:35
|
#: InvenTree/validators.py:39
|
||||||
msgid "Invalid character in part name"
|
msgid "Invalid character in part name"
|
||||||
msgstr "Ungültiger Buchstabe im Teilenamen"
|
msgstr "Ungültiger Buchstabe im Teilenamen"
|
||||||
|
|
||||||
#: InvenTree/validators.py:44
|
#: InvenTree/validators.py:52
|
||||||
|
msgid "IPN must match regex pattern"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: InvenTree/validators.py:60
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Illegal character in name ({x})"
|
msgid "Illegal character in name ({x})"
|
||||||
msgstr "Ungültiges Zeichen im Namen ({x})"
|
msgstr "Ungültiges Zeichen im Namen ({x})"
|
||||||
|
|
||||||
#: InvenTree/validators.py:63 InvenTree/validators.py:79
|
#: InvenTree/validators.py:79 InvenTree/validators.py:95
|
||||||
msgid "Overage value must not be negative"
|
msgid "Overage value must not be negative"
|
||||||
msgstr "Überschuss-Wert darf nicht negativ sein"
|
msgstr "Überschuss-Wert darf nicht negativ sein"
|
||||||
|
|
||||||
#: InvenTree/validators.py:81
|
#: InvenTree/validators.py:97
|
||||||
msgid "Overage must not exceed 100%"
|
msgid "Overage must not exceed 100%"
|
||||||
msgstr "Überschuss darf 100% nicht überschreiten"
|
msgstr "Überschuss darf 100% nicht überschreiten"
|
||||||
|
|
||||||
#: InvenTree/validators.py:88
|
#: InvenTree/validators.py:104
|
||||||
msgid "Overage must be an integer value or a percentage"
|
msgid "Overage must be an integer value or a percentage"
|
||||||
msgstr "Überschuss muss eine Ganzzahl oder ein Prozentwert sein"
|
msgstr "Überschuss muss eine Ganzzahl oder ein Prozentwert sein"
|
||||||
|
|
||||||
|
#: InvenTree/views.py:548
|
||||||
|
msgid "Database Statistics"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/forms.py:35
|
#: build/forms.py:35
|
||||||
msgid "Confirm"
|
msgid "Confirm"
|
||||||
msgstr "Bestätigen"
|
msgstr "Bestätigen"
|
||||||
@ -356,41 +364,41 @@ msgstr "Teile zuweisen"
|
|||||||
msgid "The following serial numbers already exist: ({sn})"
|
msgid "The following serial numbers already exist: ({sn})"
|
||||||
msgstr "Die folgende Seriennummer existiert bereits: ({sn})"
|
msgstr "Die folgende Seriennummer existiert bereits: ({sn})"
|
||||||
|
|
||||||
#: common/models.py:65
|
#: common/models.py:69
|
||||||
msgid "Settings key (must be unique - case insensitive"
|
msgid "Settings key (must be unique - case insensitive"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Einstellungs-Schlüssel (muss einzigartig sein, Groß-/ Kleinschreibung wird "
|
"Einstellungs-Schlüssel (muss einzigartig sein, Groß-/ Kleinschreibung wird "
|
||||||
"nicht beachtet)"
|
"nicht beachtet)"
|
||||||
|
|
||||||
#: common/models.py:67
|
#: common/models.py:71
|
||||||
msgid "Settings value"
|
msgid "Settings value"
|
||||||
msgstr "Einstellungs-Wert"
|
msgstr "Einstellungs-Wert"
|
||||||
|
|
||||||
#: common/models.py:69
|
#: common/models.py:73
|
||||||
msgid "Settings description"
|
msgid "Settings description"
|
||||||
msgstr "Einstellungs-Beschreibung"
|
msgstr "Einstellungs-Beschreibung"
|
||||||
|
|
||||||
#: common/models.py:82
|
#: common/models.py:86
|
||||||
msgid "Key string must be unique"
|
msgid "Key string must be unique"
|
||||||
msgstr "Schlüsseltext muss eindeutig sein"
|
msgstr "Schlüsseltext muss eindeutig sein"
|
||||||
|
|
||||||
#: common/models.py:103
|
#: common/models.py:107
|
||||||
msgid "Currency Symbol e.g. $"
|
msgid "Currency Symbol e.g. $"
|
||||||
msgstr "Währungs-Symbol (z.B. €)"
|
msgstr "Währungs-Symbol (z.B. €)"
|
||||||
|
|
||||||
#: common/models.py:105
|
#: common/models.py:109
|
||||||
msgid "Currency Suffix e.g. AUD"
|
msgid "Currency Suffix e.g. AUD"
|
||||||
msgstr "Währungs-Suffix (z.B. EUR)"
|
msgstr "Währungs-Suffix (z.B. EUR)"
|
||||||
|
|
||||||
#: common/models.py:107
|
#: common/models.py:111
|
||||||
msgid "Currency Description"
|
msgid "Currency Description"
|
||||||
msgstr "Währungs-Beschreibung"
|
msgstr "Währungs-Beschreibung"
|
||||||
|
|
||||||
#: common/models.py:109
|
#: common/models.py:113
|
||||||
msgid "Currency Value"
|
msgid "Currency Value"
|
||||||
msgstr "Währungs-Wert"
|
msgstr "Währungs-Wert"
|
||||||
|
|
||||||
#: common/models.py:111
|
#: common/models.py:115
|
||||||
msgid "Use this currency as the base currency"
|
msgid "Use this currency as the base currency"
|
||||||
msgstr "Benutze diese Währung als Basis-Währung"
|
msgstr "Benutze diese Währung als Basis-Währung"
|
||||||
|
|
||||||
@ -582,7 +590,8 @@ msgstr ""
|
|||||||
|
|
||||||
#: company/templates/company/index.html:69
|
#: company/templates/company/index.html:69
|
||||||
#: company/templates/company/partdetail.html:6
|
#: company/templates/company/partdetail.html:6
|
||||||
#: part/templates/part/category.html:73
|
#: part/templates/part/category.html:73 templates/navbar.html:10
|
||||||
|
#: templates/stats.html:7 templates/stats.html:10
|
||||||
msgid "Parts"
|
msgid "Parts"
|
||||||
msgstr "Teile"
|
msgstr "Teile"
|
||||||
|
|
||||||
@ -657,6 +666,7 @@ msgid "No price breaks have been added for this part"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
|
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
|
||||||
|
#: templates/navbar.html:11
|
||||||
msgid "Stock"
|
msgid "Stock"
|
||||||
msgstr "Lagerbestand"
|
msgstr "Lagerbestand"
|
||||||
|
|
||||||
@ -696,7 +706,7 @@ msgstr "Link auf externe Seite"
|
|||||||
msgid "Order notes"
|
msgid "Order notes"
|
||||||
msgstr "Bestell-Notizen"
|
msgstr "Bestell-Notizen"
|
||||||
|
|
||||||
#: order/models.py:159 order/models.py:210 part/views.py:1065
|
#: order/models.py:159 order/models.py:210 part/views.py:1067
|
||||||
#: stock/models.py:440
|
#: stock/models.py:440
|
||||||
msgid "Quantity must be greater than zero"
|
msgid "Quantity must be greater than zero"
|
||||||
msgstr "Anzahl muss größer Null sein"
|
msgstr "Anzahl muss größer Null sein"
|
||||||
@ -1062,6 +1072,7 @@ msgid "Delete attachment"
|
|||||||
msgstr "Anhang löschen"
|
msgstr "Anhang löschen"
|
||||||
|
|
||||||
#: part/templates/part/category.html:13 part/templates/part/category.html:69
|
#: part/templates/part/category.html:13 part/templates/part/category.html:69
|
||||||
|
#: templates/stats.html:14
|
||||||
msgid "Part Categories"
|
msgid "Part Categories"
|
||||||
msgstr "Teile-Kategorien"
|
msgstr "Teile-Kategorien"
|
||||||
|
|
||||||
@ -1246,6 +1257,7 @@ msgid "BOM"
|
|||||||
msgstr "Stückliste"
|
msgstr "Stückliste"
|
||||||
|
|
||||||
#: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102
|
#: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102
|
||||||
|
#: templates/navbar.html:12
|
||||||
msgid "Build"
|
msgid "Build"
|
||||||
msgstr "Bau"
|
msgstr "Bau"
|
||||||
|
|
||||||
@ -1253,7 +1265,7 @@ msgstr "Bau"
|
|||||||
msgid "Used In"
|
msgid "Used In"
|
||||||
msgstr "Benutzt in"
|
msgstr "Benutzt in"
|
||||||
|
|
||||||
#: part/templates/part/tabs.html:37
|
#: part/templates/part/tabs.html:37 templates/navbar.html:13
|
||||||
msgid "Suppliers"
|
msgid "Suppliers"
|
||||||
msgstr "Zulieferer"
|
msgstr "Zulieferer"
|
||||||
|
|
||||||
@ -1270,27 +1282,27 @@ msgstr "Anhänge"
|
|||||||
msgid "Set category for {n} parts"
|
msgid "Set category for {n} parts"
|
||||||
msgstr "Kategorie für {n} Teile setzen"
|
msgstr "Kategorie für {n} Teile setzen"
|
||||||
|
|
||||||
#: part/views.py:806
|
#: part/views.py:808
|
||||||
msgid "No BOM file provided"
|
msgid "No BOM file provided"
|
||||||
msgstr "Keine Stückliste angegeben"
|
msgstr "Keine Stückliste angegeben"
|
||||||
|
|
||||||
#: part/views.py:1067
|
#: part/views.py:1069
|
||||||
msgid "Enter a valid quantity"
|
msgid "Enter a valid quantity"
|
||||||
msgstr "Bitte eine gültige Anzahl eingeben"
|
msgstr "Bitte eine gültige Anzahl eingeben"
|
||||||
|
|
||||||
#: part/views.py:1091 part/views.py:1094
|
#: part/views.py:1093 part/views.py:1096
|
||||||
msgid "Select valid part"
|
msgid "Select valid part"
|
||||||
msgstr "Bitte ein gültiges Teil auswählen"
|
msgstr "Bitte ein gültiges Teil auswählen"
|
||||||
|
|
||||||
#: part/views.py:1100
|
#: part/views.py:1102
|
||||||
msgid "Duplicate part selected"
|
msgid "Duplicate part selected"
|
||||||
msgstr "Teil doppelt ausgewählt"
|
msgstr "Teil doppelt ausgewählt"
|
||||||
|
|
||||||
#: part/views.py:1128
|
#: part/views.py:1130
|
||||||
msgid "Select a part"
|
msgid "Select a part"
|
||||||
msgstr "Teil auswählen"
|
msgstr "Teil auswählen"
|
||||||
|
|
||||||
#: part/views.py:1132
|
#: part/views.py:1134
|
||||||
msgid "Specify quantity"
|
msgid "Specify quantity"
|
||||||
msgstr "Anzahl angeben"
|
msgstr "Anzahl angeben"
|
||||||
|
|
||||||
@ -1504,7 +1516,8 @@ msgid "Sublocations"
|
|||||||
msgstr "Sub-Standorte"
|
msgstr "Sub-Standorte"
|
||||||
|
|
||||||
#: stock/templates/stock/location.html:52
|
#: stock/templates/stock/location.html:52
|
||||||
#: stock/templates/stock/location.html:64
|
#: stock/templates/stock/location.html:64 templates/stats.html:18
|
||||||
|
#: templates/stats.html:21
|
||||||
msgid "Stock Items"
|
msgid "Stock Items"
|
||||||
msgstr "Lagerobjekte"
|
msgstr "Lagerobjekte"
|
||||||
|
|
||||||
@ -1513,7 +1526,7 @@ msgid "Stock Details"
|
|||||||
msgstr "Objekt-Details"
|
msgstr "Objekt-Details"
|
||||||
|
|
||||||
#: stock/templates/stock/location.html:60
|
#: stock/templates/stock/location.html:60
|
||||||
#: templates/InvenTree/search_stock_location.html:6
|
#: templates/InvenTree/search_stock_location.html:6 templates/stats.html:25
|
||||||
msgid "Stock Locations"
|
msgid "Stock Locations"
|
||||||
msgstr "Lagerobjekt-Standorte"
|
msgstr "Lagerobjekt-Standorte"
|
||||||
|
|
||||||
@ -1696,3 +1709,37 @@ msgstr "InvenTree-Dokumentation"
|
|||||||
#: templates/about.html:37
|
#: templates/about.html:37
|
||||||
msgid "View Code on GitHub"
|
msgid "View Code on GitHub"
|
||||||
msgstr "Code auf GitHub ansehen"
|
msgstr "Code auf GitHub ansehen"
|
||||||
|
|
||||||
|
#: templates/navbar.html:14
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "On Order"
|
||||||
|
msgid "Orders"
|
||||||
|
msgstr "bestellt"
|
||||||
|
|
||||||
|
#: templates/navbar.html:23
|
||||||
|
msgid "Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:26
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "Settings value"
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr "Einstellungs-Wert"
|
||||||
|
|
||||||
|
#: templates/navbar.html:27
|
||||||
|
msgid "Logout"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:29
|
||||||
|
msgid "Login"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:32
|
||||||
|
msgid "About InvenTree"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:33
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "Status"
|
||||||
|
msgid "Statistics"
|
||||||
|
msgstr "Status"
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-02-02 10:40+0000\n"
|
"POT-Creation-Date: 2020-02-03 10:28+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -108,27 +108,35 @@ msgstr ""
|
|||||||
msgid "Allocated"
|
msgid "Allocated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:35
|
#: InvenTree/validators.py:39
|
||||||
msgid "Invalid character in part name"
|
msgid "Invalid character in part name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:44
|
#: InvenTree/validators.py:52
|
||||||
|
msgid "IPN must match regex pattern"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: InvenTree/validators.py:60
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Illegal character in name ({x})"
|
msgid "Illegal character in name ({x})"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:63 InvenTree/validators.py:79
|
#: InvenTree/validators.py:79 InvenTree/validators.py:95
|
||||||
msgid "Overage value must not be negative"
|
msgid "Overage value must not be negative"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:81
|
#: InvenTree/validators.py:97
|
||||||
msgid "Overage must not exceed 100%"
|
msgid "Overage must not exceed 100%"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:88
|
#: InvenTree/validators.py:104
|
||||||
msgid "Overage must be an integer value or a percentage"
|
msgid "Overage must be an integer value or a percentage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: InvenTree/views.py:548
|
||||||
|
msgid "Database Statistics"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/forms.py:35
|
#: build/forms.py:35
|
||||||
msgid "Confirm"
|
msgid "Confirm"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -352,39 +360,39 @@ msgstr ""
|
|||||||
msgid "The following serial numbers already exist: ({sn})"
|
msgid "The following serial numbers already exist: ({sn})"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:65
|
#: common/models.py:69
|
||||||
msgid "Settings key (must be unique - case insensitive"
|
msgid "Settings key (must be unique - case insensitive"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:67
|
#: common/models.py:71
|
||||||
msgid "Settings value"
|
msgid "Settings value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:69
|
#: common/models.py:73
|
||||||
msgid "Settings description"
|
msgid "Settings description"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:82
|
#: common/models.py:86
|
||||||
msgid "Key string must be unique"
|
msgid "Key string must be unique"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:103
|
#: common/models.py:107
|
||||||
msgid "Currency Symbol e.g. $"
|
msgid "Currency Symbol e.g. $"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:105
|
#: common/models.py:109
|
||||||
msgid "Currency Suffix e.g. AUD"
|
msgid "Currency Suffix e.g. AUD"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:107
|
#: common/models.py:111
|
||||||
msgid "Currency Description"
|
msgid "Currency Description"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:109
|
#: common/models.py:113
|
||||||
msgid "Currency Value"
|
msgid "Currency Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:111
|
#: common/models.py:115
|
||||||
msgid "Use this currency as the base currency"
|
msgid "Use this currency as the base currency"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -562,7 +570,8 @@ msgstr ""
|
|||||||
|
|
||||||
#: company/templates/company/index.html:69
|
#: company/templates/company/index.html:69
|
||||||
#: company/templates/company/partdetail.html:6
|
#: company/templates/company/partdetail.html:6
|
||||||
#: part/templates/part/category.html:73
|
#: part/templates/part/category.html:73 templates/navbar.html:10
|
||||||
|
#: templates/stats.html:7 templates/stats.html:10
|
||||||
msgid "Parts"
|
msgid "Parts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -626,6 +635,7 @@ msgid "No price breaks have been added for this part"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
|
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
|
||||||
|
#: templates/navbar.html:11
|
||||||
msgid "Stock"
|
msgid "Stock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -665,7 +675,7 @@ msgstr ""
|
|||||||
msgid "Order notes"
|
msgid "Order notes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: order/models.py:159 order/models.py:210 part/views.py:1065
|
#: order/models.py:159 order/models.py:210 part/views.py:1067
|
||||||
#: stock/models.py:440
|
#: stock/models.py:440
|
||||||
msgid "Quantity must be greater than zero"
|
msgid "Quantity must be greater than zero"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -1027,6 +1037,7 @@ msgid "Delete attachment"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/templates/part/category.html:13 part/templates/part/category.html:69
|
#: part/templates/part/category.html:13 part/templates/part/category.html:69
|
||||||
|
#: templates/stats.html:14
|
||||||
msgid "Part Categories"
|
msgid "Part Categories"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1211,6 +1222,7 @@ msgid "BOM"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102
|
#: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102
|
||||||
|
#: templates/navbar.html:12
|
||||||
msgid "Build"
|
msgid "Build"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1218,7 +1230,7 @@ msgstr ""
|
|||||||
msgid "Used In"
|
msgid "Used In"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/templates/part/tabs.html:37
|
#: part/templates/part/tabs.html:37 templates/navbar.html:13
|
||||||
msgid "Suppliers"
|
msgid "Suppliers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1235,27 +1247,27 @@ msgstr ""
|
|||||||
msgid "Set category for {n} parts"
|
msgid "Set category for {n} parts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:806
|
#: part/views.py:808
|
||||||
msgid "No BOM file provided"
|
msgid "No BOM file provided"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1067
|
#: part/views.py:1069
|
||||||
msgid "Enter a valid quantity"
|
msgid "Enter a valid quantity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1091 part/views.py:1094
|
#: part/views.py:1093 part/views.py:1096
|
||||||
msgid "Select valid part"
|
msgid "Select valid part"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1100
|
#: part/views.py:1102
|
||||||
msgid "Duplicate part selected"
|
msgid "Duplicate part selected"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1128
|
#: part/views.py:1130
|
||||||
msgid "Select a part"
|
msgid "Select a part"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1132
|
#: part/views.py:1134
|
||||||
msgid "Specify quantity"
|
msgid "Specify quantity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1462,7 +1474,8 @@ msgid "Sublocations"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: stock/templates/stock/location.html:52
|
#: stock/templates/stock/location.html:52
|
||||||
#: stock/templates/stock/location.html:64
|
#: stock/templates/stock/location.html:64 templates/stats.html:18
|
||||||
|
#: templates/stats.html:21
|
||||||
msgid "Stock Items"
|
msgid "Stock Items"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1471,7 +1484,7 @@ msgid "Stock Details"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: stock/templates/stock/location.html:60
|
#: stock/templates/stock/location.html:60
|
||||||
#: templates/InvenTree/search_stock_location.html:6
|
#: templates/InvenTree/search_stock_location.html:6 templates/stats.html:25
|
||||||
msgid "Stock Locations"
|
msgid "Stock Locations"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1652,3 +1665,31 @@ msgstr ""
|
|||||||
#: templates/about.html:37
|
#: templates/about.html:37
|
||||||
msgid "View Code on GitHub"
|
msgid "View Code on GitHub"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:14
|
||||||
|
msgid "Orders"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:23
|
||||||
|
msgid "Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:26
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:27
|
||||||
|
msgid "Logout"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:29
|
||||||
|
msgid "Login"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:32
|
||||||
|
msgid "About InvenTree"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:33
|
||||||
|
msgid "Statistics"
|
||||||
|
msgstr ""
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-02-02 10:40+0000\n"
|
"POT-Creation-Date: 2020-02-03 10:28+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -108,27 +108,35 @@ msgstr ""
|
|||||||
msgid "Allocated"
|
msgid "Allocated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:35
|
#: InvenTree/validators.py:39
|
||||||
msgid "Invalid character in part name"
|
msgid "Invalid character in part name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:44
|
#: InvenTree/validators.py:52
|
||||||
|
msgid "IPN must match regex pattern"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: InvenTree/validators.py:60
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Illegal character in name ({x})"
|
msgid "Illegal character in name ({x})"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:63 InvenTree/validators.py:79
|
#: InvenTree/validators.py:79 InvenTree/validators.py:95
|
||||||
msgid "Overage value must not be negative"
|
msgid "Overage value must not be negative"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:81
|
#: InvenTree/validators.py:97
|
||||||
msgid "Overage must not exceed 100%"
|
msgid "Overage must not exceed 100%"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: InvenTree/validators.py:88
|
#: InvenTree/validators.py:104
|
||||||
msgid "Overage must be an integer value or a percentage"
|
msgid "Overage must be an integer value or a percentage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: InvenTree/views.py:548
|
||||||
|
msgid "Database Statistics"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/forms.py:35
|
#: build/forms.py:35
|
||||||
msgid "Confirm"
|
msgid "Confirm"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -352,39 +360,39 @@ msgstr ""
|
|||||||
msgid "The following serial numbers already exist: ({sn})"
|
msgid "The following serial numbers already exist: ({sn})"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:65
|
#: common/models.py:69
|
||||||
msgid "Settings key (must be unique - case insensitive"
|
msgid "Settings key (must be unique - case insensitive"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:67
|
#: common/models.py:71
|
||||||
msgid "Settings value"
|
msgid "Settings value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:69
|
#: common/models.py:73
|
||||||
msgid "Settings description"
|
msgid "Settings description"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:82
|
#: common/models.py:86
|
||||||
msgid "Key string must be unique"
|
msgid "Key string must be unique"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:103
|
#: common/models.py:107
|
||||||
msgid "Currency Symbol e.g. $"
|
msgid "Currency Symbol e.g. $"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:105
|
#: common/models.py:109
|
||||||
msgid "Currency Suffix e.g. AUD"
|
msgid "Currency Suffix e.g. AUD"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:107
|
#: common/models.py:111
|
||||||
msgid "Currency Description"
|
msgid "Currency Description"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:109
|
#: common/models.py:113
|
||||||
msgid "Currency Value"
|
msgid "Currency Value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: common/models.py:111
|
#: common/models.py:115
|
||||||
msgid "Use this currency as the base currency"
|
msgid "Use this currency as the base currency"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -562,7 +570,8 @@ msgstr ""
|
|||||||
|
|
||||||
#: company/templates/company/index.html:69
|
#: company/templates/company/index.html:69
|
||||||
#: company/templates/company/partdetail.html:6
|
#: company/templates/company/partdetail.html:6
|
||||||
#: part/templates/part/category.html:73
|
#: part/templates/part/category.html:73 templates/navbar.html:10
|
||||||
|
#: templates/stats.html:7 templates/stats.html:10
|
||||||
msgid "Parts"
|
msgid "Parts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -626,6 +635,7 @@ msgid "No price breaks have been added for this part"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
|
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
|
||||||
|
#: templates/navbar.html:11
|
||||||
msgid "Stock"
|
msgid "Stock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -665,7 +675,7 @@ msgstr ""
|
|||||||
msgid "Order notes"
|
msgid "Order notes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: order/models.py:159 order/models.py:210 part/views.py:1065
|
#: order/models.py:159 order/models.py:210 part/views.py:1067
|
||||||
#: stock/models.py:440
|
#: stock/models.py:440
|
||||||
msgid "Quantity must be greater than zero"
|
msgid "Quantity must be greater than zero"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -1027,6 +1037,7 @@ msgid "Delete attachment"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/templates/part/category.html:13 part/templates/part/category.html:69
|
#: part/templates/part/category.html:13 part/templates/part/category.html:69
|
||||||
|
#: templates/stats.html:14
|
||||||
msgid "Part Categories"
|
msgid "Part Categories"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1211,6 +1222,7 @@ msgid "BOM"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102
|
#: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102
|
||||||
|
#: templates/navbar.html:12
|
||||||
msgid "Build"
|
msgid "Build"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1218,7 +1230,7 @@ msgstr ""
|
|||||||
msgid "Used In"
|
msgid "Used In"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/templates/part/tabs.html:37
|
#: part/templates/part/tabs.html:37 templates/navbar.html:13
|
||||||
msgid "Suppliers"
|
msgid "Suppliers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1235,27 +1247,27 @@ msgstr ""
|
|||||||
msgid "Set category for {n} parts"
|
msgid "Set category for {n} parts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:806
|
#: part/views.py:808
|
||||||
msgid "No BOM file provided"
|
msgid "No BOM file provided"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1067
|
#: part/views.py:1069
|
||||||
msgid "Enter a valid quantity"
|
msgid "Enter a valid quantity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1091 part/views.py:1094
|
#: part/views.py:1093 part/views.py:1096
|
||||||
msgid "Select valid part"
|
msgid "Select valid part"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1100
|
#: part/views.py:1102
|
||||||
msgid "Duplicate part selected"
|
msgid "Duplicate part selected"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1128
|
#: part/views.py:1130
|
||||||
msgid "Select a part"
|
msgid "Select a part"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: part/views.py:1132
|
#: part/views.py:1134
|
||||||
msgid "Specify quantity"
|
msgid "Specify quantity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1462,7 +1474,8 @@ msgid "Sublocations"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: stock/templates/stock/location.html:52
|
#: stock/templates/stock/location.html:52
|
||||||
#: stock/templates/stock/location.html:64
|
#: stock/templates/stock/location.html:64 templates/stats.html:18
|
||||||
|
#: templates/stats.html:21
|
||||||
msgid "Stock Items"
|
msgid "Stock Items"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1471,7 +1484,7 @@ msgid "Stock Details"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: stock/templates/stock/location.html:60
|
#: stock/templates/stock/location.html:60
|
||||||
#: templates/InvenTree/search_stock_location.html:6
|
#: templates/InvenTree/search_stock_location.html:6 templates/stats.html:25
|
||||||
msgid "Stock Locations"
|
msgid "Stock Locations"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -1652,3 +1665,31 @@ msgstr ""
|
|||||||
#: templates/about.html:37
|
#: templates/about.html:37
|
||||||
msgid "View Code on GitHub"
|
msgid "View Code on GitHub"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:14
|
||||||
|
msgid "Orders"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:23
|
||||||
|
msgid "Admin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:26
|
||||||
|
msgid "Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:27
|
||||||
|
msgid "Logout"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:29
|
||||||
|
msgid "Login"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:32
|
||||||
|
msgid "About InvenTree"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/navbar.html:33
|
||||||
|
msgid "Statistics"
|
||||||
|
msgstr ""
|
||||||
|
19
InvenTree/part/migrations/0028_auto_20200203_1007.py
Normal file
19
InvenTree/part/migrations/0028_auto_20200203_1007.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.2.9 on 2020-02-03 10:07
|
||||||
|
|
||||||
|
import InvenTree.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0027_auto_20200202_1024'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='part',
|
||||||
|
name='IPN',
|
||||||
|
field=models.CharField(blank=True, help_text='Internal Part Number', max_length=100, validators=[InvenTree.validators.validate_part_ipn]),
|
||||||
|
),
|
||||||
|
]
|
@ -349,7 +349,7 @@ class Part(models.Model):
|
|||||||
on_delete=models.DO_NOTHING,
|
on_delete=models.DO_NOTHING,
|
||||||
help_text=_('Part category'))
|
help_text=_('Part category'))
|
||||||
|
|
||||||
IPN = models.CharField(max_length=100, blank=True, help_text=_('Internal Part Number'))
|
IPN = models.CharField(max_length=100, blank=True, help_text=_('Internal Part Number'), validators=[validators.validate_part_ipn])
|
||||||
|
|
||||||
revision = models.CharField(max_length=100, blank=True, help_text=_('Part revision or version number'))
|
revision = models.CharField(max_length=100, blank=True, help_text=_('Part revision or version number'))
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ from django import template
|
|||||||
from InvenTree import version
|
from InvenTree import version
|
||||||
from InvenTree.helpers import decimal2string
|
from InvenTree.helpers import decimal2string
|
||||||
|
|
||||||
|
from common.models import InvenTreeSetting
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
@ -69,3 +71,8 @@ def inventree_github_url(*args, **kwargs):
|
|||||||
def inventree_docs_url(*args, **kwargs):
|
def inventree_docs_url(*args, **kwargs):
|
||||||
""" Return URL for InvenTree documenation site """
|
""" Return URL for InvenTree documenation site """
|
||||||
return "https://inventree.github.io"
|
return "https://inventree.github.io"
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag()
|
||||||
|
def inventree_setting(key, *args, **kwargs):
|
||||||
|
return InvenTreeSetting.get_setting(key)
|
||||||
|
@ -23,7 +23,7 @@ from .models import PartParameterTemplate, PartParameter
|
|||||||
from .models import BomItem
|
from .models import BomItem
|
||||||
from .models import match_part_names
|
from .models import match_part_names
|
||||||
|
|
||||||
from common.models import Currency
|
from common.models import Currency, InvenTreeSetting
|
||||||
from company.models import SupplierPart
|
from company.models import SupplierPart
|
||||||
|
|
||||||
from . import forms as part_forms
|
from . import forms as part_forms
|
||||||
@ -396,6 +396,8 @@ class PartDuplicate(AjaxCreateView):
|
|||||||
else:
|
else:
|
||||||
initials = super(AjaxCreateView, self).get_initial()
|
initials = super(AjaxCreateView, self).get_initial()
|
||||||
|
|
||||||
|
initials['deep_copy'] = str2bool(InvenTreeSetting.get_setting('part_deep_copy', True))
|
||||||
|
|
||||||
return initials
|
return initials
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user