From 356b6cf15b0f8e8cfd4e7e105bda9c2cb4f689e7 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 3 Feb 2020 20:51:53 +1100 Subject: [PATCH 1/4] Load default settings on InvenTree launch --- InvenTree/common/apps.py | 38 +++++++++++++++++++ InvenTree/common/kvp.yaml | 13 +++++++ .../migrations/0006_auto_20200203_0951.py | 17 +++++++++ InvenTree/common/models.py | 4 ++ .../part/templatetags/inventree_extras.py | 7 ++++ 5 files changed, 79 insertions(+) create mode 100644 InvenTree/common/kvp.yaml create mode 100644 InvenTree/common/migrations/0006_auto_20200203_0951.py diff --git a/InvenTree/common/apps.py b/InvenTree/common/apps.py index 5f2f078473..9252d40d9e 100644 --- a/InvenTree/common/apps.py +++ b/InvenTree/common/apps.py @@ -1,5 +1,43 @@ from django.apps import AppConfig +from django.db.utils import OperationalError + +import yaml class CommonConfig(AppConfig): 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 + + with open('./common/kvp.yaml') 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 diff --git a/InvenTree/common/kvp.yaml b/InvenTree/common/kvp.yaml new file mode 100644 index 0000000000..9200b22c31 --- /dev/null +++ b/InvenTree/common/kvp.yaml @@ -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' \ No newline at end of file diff --git a/InvenTree/common/migrations/0006_auto_20200203_0951.py b/InvenTree/common/migrations/0006_auto_20200203_0951.py new file mode 100644 index 0000000000..78460cfd62 --- /dev/null +++ b/InvenTree/common/migrations/0006_auto_20200203_0951.py @@ -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'}, + ), + ] diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 0b8795484b..6a2f6d8fa3 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -21,6 +21,10 @@ class InvenTreeSetting(models.Model): even if that key does not exist. """ + class Meta: + verbose_name = "InvenTree Setting" + verbose_name_plural = "InvenTree Settings" + @classmethod def get_setting(cls, key, backup_value=None): """ diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index 323d65050e..0a111bfb0e 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -6,6 +6,8 @@ from django import template from InvenTree import version from InvenTree.helpers import decimal2string +from common.models import InvenTreeSetting + register = template.Library() @@ -69,3 +71,8 @@ def inventree_github_url(*args, **kwargs): def inventree_docs_url(*args, **kwargs): """ Return URL for InvenTree documenation site """ return "https://inventree.github.io" + + +@register.simple_tag() +def inventree_setting(key, *args, **kwargs): + return InvenTreeSetting.get_setting(key) From 9cef038d6a64ad0a64c7787aa7003ad05690a35c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 3 Feb 2020 21:09:24 +1100 Subject: [PATCH 2/4] IPN must match regex validator (if one is provided) --- InvenTree/InvenTree/validators.py | 15 +++++++++++++++ .../migrations/0028_auto_20200203_1007.py | 19 +++++++++++++++++++ InvenTree/part/models.py | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 InvenTree/part/migrations/0028_auto_20200203_1007.py diff --git a/InvenTree/InvenTree/validators.py b/InvenTree/InvenTree/validators.py index 98c0532d14..543671bd5d 100644 --- a/InvenTree/InvenTree/validators.py +++ b/InvenTree/InvenTree/validators.py @@ -6,6 +6,10 @@ from django.conf import settings from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ +from common.models import InvenTreeSetting + +import re + def allowable_url_schemes(): """ Return the list of allowable URL schemes. @@ -35,6 +39,17 @@ def validate_part_name(value): _('Invalid character in part name') ) +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): """ Prevent illegal characters in tree item names """ diff --git a/InvenTree/part/migrations/0028_auto_20200203_1007.py b/InvenTree/part/migrations/0028_auto_20200203_1007.py new file mode 100644 index 0000000000..eca1788f06 --- /dev/null +++ b/InvenTree/part/migrations/0028_auto_20200203_1007.py @@ -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]), + ), + ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 2df55ad73b..fb270f06f0 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -349,7 +349,7 @@ class Part(models.Model): on_delete=models.DO_NOTHING, 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')) From d059aff4f8749f41c3246524dd791ca0eefd15f9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 3 Feb 2020 21:14:06 +1100 Subject: [PATCH 3/4] Use the part_deep_copy setting to set the default deep_copy value when duplicating a part --- InvenTree/part/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 925e9ce48a..f36cedf48e 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -23,7 +23,7 @@ from .models import PartParameterTemplate, PartParameter from .models import BomItem from .models import match_part_names -from common.models import Currency +from common.models import Currency, InvenTreeSetting from company.models import SupplierPart from . import forms as part_forms @@ -396,6 +396,8 @@ class PartDuplicate(AjaxCreateView): else: initials = super(AjaxCreateView, self).get_initial() + initials['deep_copy'] = str2bool(InvenTreeSetting.get_setting('part_deep_copy', True)) + return initials From 41336bd5493c35c4cc656b0e4929096d2f8b11c6 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 3 Feb 2020 21:28:47 +1100 Subject: [PATCH 4/4] Fixes --- InvenTree/InvenTree/validators.py | 1 + InvenTree/common/apps.py | 7 +- InvenTree/locale/de/LC_MESSAGES/django.po | 99 +++++++++++++++++------ InvenTree/locale/en/LC_MESSAGES/django.po | 93 +++++++++++++++------ InvenTree/locale/es/LC_MESSAGES/django.po | 93 +++++++++++++++------ 5 files changed, 214 insertions(+), 79 deletions(-) diff --git a/InvenTree/InvenTree/validators.py b/InvenTree/InvenTree/validators.py index 543671bd5d..b1e455283b 100644 --- a/InvenTree/InvenTree/validators.py +++ b/InvenTree/InvenTree/validators.py @@ -39,6 +39,7 @@ def validate_part_name(value): _('Invalid character in part name') ) + def validate_part_ipn(value): """ Validate the Part IPN against regex rule """ diff --git a/InvenTree/common/apps.py b/InvenTree/common/apps.py index 9252d40d9e..b2b4b506c1 100644 --- a/InvenTree/common/apps.py +++ b/InvenTree/common/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig from django.db.utils import OperationalError +import os + import yaml @@ -18,7 +20,10 @@ class CommonConfig(AppConfig): from .models import InvenTreeSetting - with open('./common/kvp.yaml') as kvp: + 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: diff --git a/InvenTree/locale/de/LC_MESSAGES/django.po b/InvenTree/locale/de/LC_MESSAGES/django.po index 2a00f094e6..151190ca0e 100644 --- a/InvenTree/locale/de/LC_MESSAGES/django.po +++ b/InvenTree/locale/de/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \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" "Last-Translator: Christian Schlüter \n" "Language-Team: C \n" @@ -109,27 +109,35 @@ msgstr "Zerstört" msgid "Allocated" msgstr "Zugeordnet" -#: InvenTree/validators.py:35 +#: InvenTree/validators.py:39 msgid "Invalid character in part name" 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 msgid "Illegal character in name ({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" msgstr "Überschuss-Wert darf nicht negativ sein" -#: InvenTree/validators.py:81 +#: InvenTree/validators.py:97 msgid "Overage must not exceed 100%" msgstr "Überschuss darf 100% nicht überschreiten" -#: InvenTree/validators.py:88 +#: InvenTree/validators.py:104 msgid "Overage must be an integer value or a percentage" msgstr "Überschuss muss eine Ganzzahl oder ein Prozentwert sein" +#: InvenTree/views.py:548 +msgid "Database Statistics" +msgstr "" + #: build/forms.py:35 msgid "Confirm" msgstr "Bestätigen" @@ -356,41 +364,41 @@ msgstr "Teile zuweisen" msgid "The following serial numbers already exist: ({sn})" msgstr "Die folgende Seriennummer existiert bereits: ({sn})" -#: common/models.py:65 +#: common/models.py:69 msgid "Settings key (must be unique - case insensitive" msgstr "" "Einstellungs-Schlüssel (muss einzigartig sein, Groß-/ Kleinschreibung wird " "nicht beachtet)" -#: common/models.py:67 +#: common/models.py:71 msgid "Settings value" msgstr "Einstellungs-Wert" -#: common/models.py:69 +#: common/models.py:73 msgid "Settings description" msgstr "Einstellungs-Beschreibung" -#: common/models.py:82 +#: common/models.py:86 msgid "Key string must be unique" msgstr "Schlüsseltext muss eindeutig sein" -#: common/models.py:103 +#: common/models.py:107 msgid "Currency Symbol e.g. $" msgstr "Währungs-Symbol (z.B. €)" -#: common/models.py:105 +#: common/models.py:109 msgid "Currency Suffix e.g. AUD" msgstr "Währungs-Suffix (z.B. EUR)" -#: common/models.py:107 +#: common/models.py:111 msgid "Currency Description" msgstr "Währungs-Beschreibung" -#: common/models.py:109 +#: common/models.py:113 msgid "Currency Value" msgstr "Währungs-Wert" -#: common/models.py:111 +#: common/models.py:115 msgid "Use this currency as the base currency" msgstr "Benutze diese Währung als Basis-Währung" @@ -582,7 +590,8 @@ msgstr "" #: company/templates/company/index.html:69 #: 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" msgstr "Teile" @@ -657,6 +666,7 @@ msgid "No price breaks have been added for this part" msgstr "" #: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17 +#: templates/navbar.html:11 msgid "Stock" msgstr "Lagerbestand" @@ -696,7 +706,7 @@ msgstr "Link auf externe Seite" msgid "Order notes" 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 msgid "Quantity must be greater than zero" msgstr "Anzahl muss größer Null sein" @@ -1062,6 +1072,7 @@ msgid "Delete attachment" msgstr "Anhang löschen" #: part/templates/part/category.html:13 part/templates/part/category.html:69 +#: templates/stats.html:14 msgid "Part Categories" msgstr "Teile-Kategorien" @@ -1246,6 +1257,7 @@ msgid "BOM" msgstr "Stückliste" #: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102 +#: templates/navbar.html:12 msgid "Build" msgstr "Bau" @@ -1253,7 +1265,7 @@ msgstr "Bau" msgid "Used In" msgstr "Benutzt in" -#: part/templates/part/tabs.html:37 +#: part/templates/part/tabs.html:37 templates/navbar.html:13 msgid "Suppliers" msgstr "Zulieferer" @@ -1270,27 +1282,27 @@ msgstr "Anhänge" msgid "Set category for {n} parts" msgstr "Kategorie für {n} Teile setzen" -#: part/views.py:806 +#: part/views.py:808 msgid "No BOM file provided" msgstr "Keine Stückliste angegeben" -#: part/views.py:1067 +#: part/views.py:1069 msgid "Enter a valid quantity" 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" msgstr "Bitte ein gültiges Teil auswählen" -#: part/views.py:1100 +#: part/views.py:1102 msgid "Duplicate part selected" msgstr "Teil doppelt ausgewählt" -#: part/views.py:1128 +#: part/views.py:1130 msgid "Select a part" msgstr "Teil auswählen" -#: part/views.py:1132 +#: part/views.py:1134 msgid "Specify quantity" msgstr "Anzahl angeben" @@ -1504,7 +1516,8 @@ msgid "Sublocations" msgstr "Sub-Standorte" #: 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" msgstr "Lagerobjekte" @@ -1513,7 +1526,7 @@ msgid "Stock Details" msgstr "Objekt-Details" #: 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" msgstr "Lagerobjekt-Standorte" @@ -1696,3 +1709,37 @@ msgstr "InvenTree-Dokumentation" #: templates/about.html:37 msgid "View Code on GitHub" 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" diff --git a/InvenTree/locale/en/LC_MESSAGES/django.po b/InvenTree/locale/en/LC_MESSAGES/django.po index e39681876e..3b7c7af271 100644 --- a/InvenTree/locale/en/LC_MESSAGES/django.po +++ b/InvenTree/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -108,27 +108,35 @@ msgstr "" msgid "Allocated" msgstr "" -#: InvenTree/validators.py:35 +#: InvenTree/validators.py:39 msgid "Invalid character in part name" msgstr "" -#: InvenTree/validators.py:44 +#: InvenTree/validators.py:52 +msgid "IPN must match regex pattern" +msgstr "" + +#: InvenTree/validators.py:60 #, python-brace-format msgid "Illegal character in name ({x})" msgstr "" -#: InvenTree/validators.py:63 InvenTree/validators.py:79 +#: InvenTree/validators.py:79 InvenTree/validators.py:95 msgid "Overage value must not be negative" msgstr "" -#: InvenTree/validators.py:81 +#: InvenTree/validators.py:97 msgid "Overage must not exceed 100%" msgstr "" -#: InvenTree/validators.py:88 +#: InvenTree/validators.py:104 msgid "Overage must be an integer value or a percentage" msgstr "" +#: InvenTree/views.py:548 +msgid "Database Statistics" +msgstr "" + #: build/forms.py:35 msgid "Confirm" msgstr "" @@ -352,39 +360,39 @@ msgstr "" msgid "The following serial numbers already exist: ({sn})" msgstr "" -#: common/models.py:65 +#: common/models.py:69 msgid "Settings key (must be unique - case insensitive" msgstr "" -#: common/models.py:67 +#: common/models.py:71 msgid "Settings value" msgstr "" -#: common/models.py:69 +#: common/models.py:73 msgid "Settings description" msgstr "" -#: common/models.py:82 +#: common/models.py:86 msgid "Key string must be unique" msgstr "" -#: common/models.py:103 +#: common/models.py:107 msgid "Currency Symbol e.g. $" msgstr "" -#: common/models.py:105 +#: common/models.py:109 msgid "Currency Suffix e.g. AUD" msgstr "" -#: common/models.py:107 +#: common/models.py:111 msgid "Currency Description" msgstr "" -#: common/models.py:109 +#: common/models.py:113 msgid "Currency Value" msgstr "" -#: common/models.py:111 +#: common/models.py:115 msgid "Use this currency as the base currency" msgstr "" @@ -562,7 +570,8 @@ msgstr "" #: company/templates/company/index.html:69 #: 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" msgstr "" @@ -626,6 +635,7 @@ msgid "No price breaks have been added for this part" msgstr "" #: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17 +#: templates/navbar.html:11 msgid "Stock" msgstr "" @@ -665,7 +675,7 @@ msgstr "" msgid "Order notes" 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 msgid "Quantity must be greater than zero" msgstr "" @@ -1027,6 +1037,7 @@ msgid "Delete attachment" msgstr "" #: part/templates/part/category.html:13 part/templates/part/category.html:69 +#: templates/stats.html:14 msgid "Part Categories" msgstr "" @@ -1211,6 +1222,7 @@ msgid "BOM" msgstr "" #: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102 +#: templates/navbar.html:12 msgid "Build" msgstr "" @@ -1218,7 +1230,7 @@ msgstr "" msgid "Used In" msgstr "" -#: part/templates/part/tabs.html:37 +#: part/templates/part/tabs.html:37 templates/navbar.html:13 msgid "Suppliers" msgstr "" @@ -1235,27 +1247,27 @@ msgstr "" msgid "Set category for {n} parts" msgstr "" -#: part/views.py:806 +#: part/views.py:808 msgid "No BOM file provided" msgstr "" -#: part/views.py:1067 +#: part/views.py:1069 msgid "Enter a valid quantity" msgstr "" -#: part/views.py:1091 part/views.py:1094 +#: part/views.py:1093 part/views.py:1096 msgid "Select valid part" msgstr "" -#: part/views.py:1100 +#: part/views.py:1102 msgid "Duplicate part selected" msgstr "" -#: part/views.py:1128 +#: part/views.py:1130 msgid "Select a part" msgstr "" -#: part/views.py:1132 +#: part/views.py:1134 msgid "Specify quantity" msgstr "" @@ -1462,7 +1474,8 @@ msgid "Sublocations" msgstr "" #: 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" msgstr "" @@ -1471,7 +1484,7 @@ msgid "Stock Details" msgstr "" #: 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" msgstr "" @@ -1652,3 +1665,31 @@ msgstr "" #: templates/about.html:37 msgid "View Code on GitHub" 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 "" diff --git a/InvenTree/locale/es/LC_MESSAGES/django.po b/InvenTree/locale/es/LC_MESSAGES/django.po index e39681876e..3b7c7af271 100644 --- a/InvenTree/locale/es/LC_MESSAGES/django.po +++ b/InvenTree/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -108,27 +108,35 @@ msgstr "" msgid "Allocated" msgstr "" -#: InvenTree/validators.py:35 +#: InvenTree/validators.py:39 msgid "Invalid character in part name" msgstr "" -#: InvenTree/validators.py:44 +#: InvenTree/validators.py:52 +msgid "IPN must match regex pattern" +msgstr "" + +#: InvenTree/validators.py:60 #, python-brace-format msgid "Illegal character in name ({x})" msgstr "" -#: InvenTree/validators.py:63 InvenTree/validators.py:79 +#: InvenTree/validators.py:79 InvenTree/validators.py:95 msgid "Overage value must not be negative" msgstr "" -#: InvenTree/validators.py:81 +#: InvenTree/validators.py:97 msgid "Overage must not exceed 100%" msgstr "" -#: InvenTree/validators.py:88 +#: InvenTree/validators.py:104 msgid "Overage must be an integer value or a percentage" msgstr "" +#: InvenTree/views.py:548 +msgid "Database Statistics" +msgstr "" + #: build/forms.py:35 msgid "Confirm" msgstr "" @@ -352,39 +360,39 @@ msgstr "" msgid "The following serial numbers already exist: ({sn})" msgstr "" -#: common/models.py:65 +#: common/models.py:69 msgid "Settings key (must be unique - case insensitive" msgstr "" -#: common/models.py:67 +#: common/models.py:71 msgid "Settings value" msgstr "" -#: common/models.py:69 +#: common/models.py:73 msgid "Settings description" msgstr "" -#: common/models.py:82 +#: common/models.py:86 msgid "Key string must be unique" msgstr "" -#: common/models.py:103 +#: common/models.py:107 msgid "Currency Symbol e.g. $" msgstr "" -#: common/models.py:105 +#: common/models.py:109 msgid "Currency Suffix e.g. AUD" msgstr "" -#: common/models.py:107 +#: common/models.py:111 msgid "Currency Description" msgstr "" -#: common/models.py:109 +#: common/models.py:113 msgid "Currency Value" msgstr "" -#: common/models.py:111 +#: common/models.py:115 msgid "Use this currency as the base currency" msgstr "" @@ -562,7 +570,8 @@ msgstr "" #: company/templates/company/index.html:69 #: 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" msgstr "" @@ -626,6 +635,7 @@ msgid "No price breaks have been added for this part" msgstr "" #: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17 +#: templates/navbar.html:11 msgid "Stock" msgstr "" @@ -665,7 +675,7 @@ msgstr "" msgid "Order notes" 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 msgid "Quantity must be greater than zero" msgstr "" @@ -1027,6 +1037,7 @@ msgid "Delete attachment" msgstr "" #: part/templates/part/category.html:13 part/templates/part/category.html:69 +#: templates/stats.html:14 msgid "Part Categories" msgstr "" @@ -1211,6 +1222,7 @@ msgid "BOM" msgstr "" #: part/templates/part/tabs.html:28 stock/templates/stock/item_base.html:102 +#: templates/navbar.html:12 msgid "Build" msgstr "" @@ -1218,7 +1230,7 @@ msgstr "" msgid "Used In" msgstr "" -#: part/templates/part/tabs.html:37 +#: part/templates/part/tabs.html:37 templates/navbar.html:13 msgid "Suppliers" msgstr "" @@ -1235,27 +1247,27 @@ msgstr "" msgid "Set category for {n} parts" msgstr "" -#: part/views.py:806 +#: part/views.py:808 msgid "No BOM file provided" msgstr "" -#: part/views.py:1067 +#: part/views.py:1069 msgid "Enter a valid quantity" msgstr "" -#: part/views.py:1091 part/views.py:1094 +#: part/views.py:1093 part/views.py:1096 msgid "Select valid part" msgstr "" -#: part/views.py:1100 +#: part/views.py:1102 msgid "Duplicate part selected" msgstr "" -#: part/views.py:1128 +#: part/views.py:1130 msgid "Select a part" msgstr "" -#: part/views.py:1132 +#: part/views.py:1134 msgid "Specify quantity" msgstr "" @@ -1462,7 +1474,8 @@ msgid "Sublocations" msgstr "" #: 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" msgstr "" @@ -1471,7 +1484,7 @@ msgid "Stock Details" msgstr "" #: 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" msgstr "" @@ -1652,3 +1665,31 @@ msgstr "" #: templates/about.html:37 msgid "View Code on GitHub" 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 ""