diff --git a/InvenTree/InvenTree/helpers.py b/InvenTree/InvenTree/helpers.py index ebdb8953fa..ba3f3525d5 100644 --- a/InvenTree/InvenTree/helpers.py +++ b/InvenTree/InvenTree/helpers.py @@ -23,7 +23,10 @@ def DownloadFile(data, filename, content_type='application/text'): filename = WrapWithQuotes(filename) - wrapper = FileWrapper(io.StringIO(data)) + if type(data) == str: + wrapper = FileWrapper(io.StringIO(data)) + else: + wrapper = FileWrapper(io.BytesIO(data)) response = StreamingHttpResponse(wrapper, content_type=content_type) response['Content-Length'] = len(data) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index ced66b2166..813d0d8ad4 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -57,7 +57,6 @@ INSTALLED_APPS = [ # Third part add-ons 'django_filters', 'rest_framework', - 'simple_history', 'crispy_forms', 'import_export', 'django_cleanup', @@ -72,7 +71,6 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'simple_history.middleware.HistoryRequestMiddleware', 'InvenTree.middleware.AuthRequiredMiddleware' ] diff --git a/InvenTree/part/admin.py b/InvenTree/part/admin.py index 610feb9744..4e63bf65e0 100644 --- a/InvenTree/part/admin.py +++ b/InvenTree/part/admin.py @@ -12,7 +12,7 @@ class PartAdmin(ImportExportModelAdmin): list_display = ('name', 'IPN', 'description', 'total_stock', 'category') -class PartCategoryAdmin(admin.ModelAdmin): +class PartCategoryAdmin(ImportExportModelAdmin): list_display = ('name', 'pathstring', 'description') diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index e13d493fc3..5601850e1c 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -87,13 +87,12 @@ class PartList(generics.ListCreateAPIView): childs = category.getUniqueChildren() for child in childs: # Ignore the top-level category (already filtered) - if child == cat_id: + if str(child) == str(cat_id): continue flt |= Q(category=child) parts_list = parts_list.filter(flt) - # Default - return all parts return parts_list permission_classes = [ diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index b340ec35c5..7524874a28 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -25,74 +25,82 @@
- - - - - - - - - -{% if part.IPN %} - - - - -{% endif %} - - - - -{% if part.default_location %} - - - - -{% endif %} -{% if part.default_supplier %} - - - - -{% endif %} - - - - - - - - - - - - - - - - - - - - - - - - -{% if part.minimum_stock > 0 %} - - - - -{% endif %} -
Part name{{ part.name }}
Description{{ part.description }}
IPN{{ part.IPN }}
Category - {% if part.category %} - {{ part.category.pathstring }} - {% endif %} -
Default Location{{ part.default_location.pathstring }}
Default Supplier - {{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }} -
Units{{ part.units }}
Buildable{% include "yesnolabel.html" with value=part.buildable %}
Consumable{% include "yesnolabel.html" with value=part.consumable %}
Trackable{% include "yesnolabel.html" with value=part.trackable %}
Purchaseable{% include "yesnolabel.html" with value=part.purchaseable %}
Salable{% include "yesnolabel.html" with value=part.salable %}
Minimum Stock{{ part.minimum_stock }}
+
+
+ + + + + + + + + + {% if part.IPN %} + + + + + {% endif %} + + + + + {% if part.default_location %} + + + + + {% endif %} + {% if part.default_supplier %} + + + + + {% endif %} + + + + +
Part name{{ part.name }}
Description{{ part.description }}
IPN{{ part.IPN }}
Category + {% if part.category %} + {{ part.category.pathstring }} + {% endif %} +
Default Location{{ part.default_location.pathstring }}
Default Supplier + {{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }} +
Units{{ part.units }}
+
+
+ + + + + + + + + + + + + + + + + + + + + + {% if part.minimum_stock > 0 %} + + + + + {% endif %} +
Buildable{% include "yesnolabel.html" with value=part.buildable %}
Consumable{% include "yesnolabel.html" with value=part.consumable %}
Trackable{% include "yesnolabel.html" with value=part.trackable %}
Purchaseable{% include "yesnolabel.html" with value=part.purchaseable %}
Salable{% include "yesnolabel.html" with value=part.salable %}
Minimum Stock{{ part.minimum_stock }}
+
+
{% if part.notes %}
diff --git a/InvenTree/static/img/inventree.png b/InvenTree/static/img/inventree.png index 49defc5711..200b6acd0b 100644 Binary files a/InvenTree/static/img/inventree.png and b/InvenTree/static/img/inventree.png differ diff --git a/InvenTree/static/script/inventree/bom.js b/InvenTree/static/script/inventree/bom.js index 273fb1c8fa..3d8db7d7e2 100644 --- a/InvenTree/static/script/inventree/bom.js +++ b/InvenTree/static/script/inventree/bom.js @@ -21,7 +21,10 @@ function downloadBom(options = {}) {