diff --git a/InvenTree/InvenTree/static/img/paper_splash.jpg b/InvenTree/InvenTree/static/img/paper_splash.jpg index e466708f3f..c7da1d6092 100644 Binary files a/InvenTree/InvenTree/static/img/paper_splash.jpg and b/InvenTree/InvenTree/static/img/paper_splash.jpg differ diff --git a/InvenTree/InvenTree/static/img/paper_splash_large.jpg b/InvenTree/InvenTree/static/img/paper_splash_large.jpg new file mode 100644 index 0000000000..e466708f3f Binary files /dev/null and b/InvenTree/InvenTree/static/img/paper_splash_large.jpg differ diff --git a/InvenTree/part/migrations/0001_initial.py b/InvenTree/part/migrations/0001_initial.py index e5183e2b5c..066d1afa4b 100644 --- a/InvenTree/part/migrations/0001_initial.py +++ b/InvenTree/part/migrations/0001_initial.py @@ -1,13 +1,29 @@ # Generated by Django 2.2 on 2019-05-20 12:04 -import InvenTree.validators -from django.conf import settings -import django.core.validators +import os + from django.db import migrations, models import django.db.models.deletion +from django.conf import settings +import django.core.validators + +import InvenTree.validators import part.models +def attach_file(instance, filename): + """ + Generate a filename for the uploaded attachment. + + 2021-11-17 - This was moved here from part.models.py, + as the function itself is no longer used, + but is still required for migration + """ + + # Construct a path to store a file attachment + return os.path.join('part_files', str(instance.part.id), filename) + + class Migration(migrations.Migration): initial = True @@ -61,7 +77,7 @@ class Migration(migrations.Migration): name='PartAttachment', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('attachment', models.FileField(help_text='Select file to attach', upload_to=part.models.attach_file)), + ('attachment', models.FileField(help_text='Select file to attach', upload_to=attach_file)), ('comment', models.CharField(help_text='File comment', max_length=100)), ], ), diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index e77008b076..cec21becc2 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -2135,20 +2135,6 @@ def after_save_part(sender, instance: Part, created, **kwargs): InvenTree.tasks.offload_task('part.tasks.notify_low_stock_if_required', instance) -def attach_file(instance, filename): - """ Function for storing a file for a PartAttachment - - Args: - instance: Instance of a PartAttachment object - filename: name of uploaded file - - Returns: - path to store file, format: 'part_file__filename' - """ - # Construct a path to store a file attachment - return os.path.join('part_files', str(instance.part.id), filename) - - class PartAttachment(InvenTreeAttachment): """ Model for storing file attachments against a Part object diff --git a/InvenTree/templates/status_codes.html b/InvenTree/templates/status_codes.html index fa448360b6..3b834a6e01 100644 --- a/InvenTree/templates/status_codes.html +++ b/InvenTree/templates/status_codes.html @@ -27,6 +27,9 @@ function {{ label }}StatusDisplay(key, options={}) { label = {{ label }}Codes[key].label; } + // Fallback option for label + label = label || 'bg-dark'; + if (value == null || value.length == 0) { value = key; label = ''; diff --git a/requirements.txt b/requirements.txt index b9f1dfd692..139942fd80 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,6 +28,7 @@ djangorestframework==3.12.4 # DRF framework flake8==3.8.3 # PEP checking gunicorn>=20.1.0 # Gunicorn web server inventree # Install the latest version of the InvenTree API python library +markdown==3.3.4 # Force particular version of markdown pep8-naming==0.11.1 # PEP naming convention extension pillow==8.3.2 # Image manipulation py-moneyed==0.8.0 # Specific version requirement for py-moneyed