diff --git a/.travis.yml b/.travis.yml index 872ef0eb0d..52d0ef1c5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,10 +48,6 @@ script: - rm inventree_default_db.sqlite3 - invoke migrate - invoke import-records -f data.json - # Run linting checks on migration files (django-migration-linter) - # Run subset of linting checks on *ALL* migration files - # Run strict migration file checks on *NEW* migrations (old ones are what they are) - - cd InvenTree && python manage.py lintmigrations 79ddea50f507e34195bad635008419daac0d7a5f -q ok ignore --no-cache && cd .. after_success: - coveralls \ No newline at end of file diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 3abb99010f..1a298240bc 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -211,7 +211,6 @@ INSTALLED_APPS = [ 'djmoney', # django-money integration 'djmoney.contrib.exchange', # django-money exchange rates 'error_report', # Error reporting in the admin interface - 'django_migration_linter', # Linting checking for migration files ] MIDDLEWARE = CONFIG.get('middleware', [ diff --git a/InvenTree/label/templates/label/label_base.html b/InvenTree/label/templates/label/label_base.html index 2c564d1132..2986c8a439 100644 --- a/InvenTree/label/templates/label/label_base.html +++ b/InvenTree/label/templates/label/label_base.html @@ -10,6 +10,11 @@ {% endblock %} } + body { + font-family: Arial, Helvetica, sans-serif; + margin: 0mm; + } + img { display: inline-block; image-rendering: pixelated; diff --git a/InvenTree/order/api.py b/InvenTree/order/api.py index ce75a47697..db4c4dcc50 100644 --- a/InvenTree/order/api.py +++ b/InvenTree/order/api.py @@ -200,6 +200,25 @@ class POLineItemList(generics.ListCreateAPIView): filter_backends = [ DjangoFilterBackend, + filters.SearchFilter, + filters.OrderingFilter + ] + + ordering_fields = [ + 'part__part__name', + 'part__MPN', + 'part__SKU', + 'reference', + 'quantity', + 'received', + ] + + search_fields = [ + 'part__part__name', + 'part__part__description', + 'part__MPN', + 'part__SKU', + 'reference', ] filter_fields = [ @@ -412,7 +431,23 @@ class SOLineItemList(generics.ListCreateAPIView): return queryset - filter_backends = [DjangoFilterBackend] + filter_backends = [ + DjangoFilterBackend, + filters.SearchFilter, + filters.OrderingFilter + ] + + ordering_fields = [ + 'part__name', + 'quantity', + 'reference', + ] + + search_fields = [ + 'part__name', + 'quantity', + 'reference', + ] filter_fields = [ 'order', diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 268e83ef4e..b22d045258 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -135,6 +135,7 @@ function setupCallbacks() { $("#po-table").inventreeTable({ onPostBody: setupCallbacks, name: 'purchaseorder', + sidePagination: 'server', formatNoMatches: function() { return "{% trans 'No line items found' %}"; }, queryParams: { order: {{ order.id }}, @@ -151,6 +152,7 @@ $("#po-table").inventreeTable({ { field: 'part', sortable: true, + sortName: 'part__part__name', title: '{% trans "Part" %}', switchable: false, formatter: function(value, row, index, field) { @@ -162,18 +164,24 @@ $("#po-table").inventreeTable({ }, }, { - sortable: true, field: 'part_detail.description', title: '{% trans "Description" %}', }, { sortable: true, + sortName: 'part__SKU', field: 'supplier_part_detail.SKU', - title: '{% trans "Order Code" %}', + title: '{% trans "SKU" %}', formatter: function(value, row, index, field) { return renderLink(value, `/supplier-part/${row.part}/`); }, }, + { + sortable: true, + sortName: 'part__MPN', + field: 'supplier_part_detail.MPN', + title: '{% trans "MPN" %}', + }, { sortable: true, field: 'reference', diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index c91cc6e51b..27bbd542dd 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -173,6 +173,7 @@ $("#so-lines-table").inventreeTable({ part_detail: true, allocations: true, }, + sidePagination: 'server', uniqueId: 'pk', url: "{% url 'api-so-line-list' %}", onPostBody: setupCallbacks, @@ -201,6 +202,7 @@ $("#so-lines-table").inventreeTable({ }, { sortable: true, + sortName: 'part__name', field: 'part', title: 'Part', formatter: function(value, row, index, field) { @@ -222,7 +224,6 @@ $("#so-lines-table").inventreeTable({ title: 'Quantity', }, { - sortable: true, field: 'allocated', {% if order.status == SalesOrderStatus.PENDING %} title: '{% trans "Allocated" %}', diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 15edfed066..60e511616a 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -853,7 +853,9 @@ class StockList(generics.ListCreateAPIView): 'status', ] - ordering = ['part__name'] + ordering = [ + 'part__name' + ] search_fields = [ 'serial', diff --git a/InvenTree/templates/js/tables.js b/InvenTree/templates/js/tables.js index f09c683bff..21e673d5ed 100644 --- a/InvenTree/templates/js/tables.js +++ b/InvenTree/templates/js/tables.js @@ -145,10 +145,7 @@ $.fn.inventreeTable = function(options) { var filters = options.queryParams || options.filters || {}; options.queryParams = function(params) { - for (var key in filters) { - params[key] = filters[key]; - } - + // Override the way that we ask the server to sort results // It seems bootstrap-table does not offer a "native" way to do this... if ('sort' in params) { @@ -170,6 +167,15 @@ $.fn.inventreeTable = function(options) { } + for (var key in filters) { + params[key] = filters[key]; + } + + // Add "order" back in (if it was originally specified by InvenTree) + // Annoyingly, "order" shadows some field names in InvenTree... + if ('order' in filters) { + params['order'] = filters['order']; + } return params; } diff --git a/requirements.txt b/requirements.txt index cf05148ebf..7bbc14bd54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,6 @@ django-money==1.1 # Django app for currency management certifi # Certifi is (most likely) installed through one of the requirements above django-error-report==0.2.0 # Error report viewer for the admin interface django-test-migrations==1.1.0 # Unit testing for database migrations -django-migration-linter==2.5.0 # Linting checks for database migrations python-barcode[images]==0.13.1 # Barcode generator qrcode[pil]==6.1 # QR code generator