diff --git a/InvenTree/InvenTree/static/script/inventree/tables.js b/InvenTree/InvenTree/static/script/inventree/tables.js index 1a50780393..4d868f94b4 100644 --- a/InvenTree/InvenTree/static/script/inventree/tables.js +++ b/InvenTree/InvenTree/static/script/inventree/tables.js @@ -131,8 +131,7 @@ $.fn.inventreeTable = function(options) { // Callback when a column is changed options.onColumnSwitch = function(field, checked) { - console.log(`${field} -> ${checked}`); - + var columns = table.bootstrapTable('getVisibleColumns'); var text = visibleColumnString(columns); diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index f723193abb..59c33ea7b6 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -214,9 +214,9 @@ {% if part.active %} - + {% else %} - + {% endif %} {% trans "Active" %} diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 0e16bfb498..26cf93e56d 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -1320,7 +1320,7 @@ class BomUpload(InvenTreeRoleMixin, FormView): # Otherwise, check to see if there is a matching IPN try: if row['part_ipn']: - part_matches = [part for part in self.allowed_parts if row['part_ipn'].lower() == part.IPN.lower()] + part_matches = [part for part in self.allowed_parts if part.IPN and row['part_ipn'].lower() == str(part.IPN.lower())] # Check for single match if len(part_matches) == 1: diff --git a/InvenTree/stock/serializers.py b/InvenTree/stock/serializers.py index 70ad1abc18..6048d5e248 100644 --- a/InvenTree/stock/serializers.py +++ b/InvenTree/stock/serializers.py @@ -208,6 +208,7 @@ class StockItemSerializer(InvenTreeModelSerializer): 'stale', 'status', 'status_text', + 'stocktake_date', 'supplier_part', 'supplier_part_detail', 'tracking_items', diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index 830f2c66f7..5d505b5280 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -1721,7 +1721,7 @@ class StockItemCreate(AjaxCreateView): item = form.save(commit=False) item.user = self.request.user - item.save() + item.save(user=self.request.user) return item @@ -1732,7 +1732,7 @@ class StockItemCreate(AjaxCreateView): item = form.save(commit=False) item.user = self.request.user - item.save() + item.save(user=self.request.user) return item diff --git a/InvenTree/templates/js/stock.js b/InvenTree/templates/js/stock.js index e3f124d252..9ce395db57 100644 --- a/InvenTree/templates/js/stock.js +++ b/InvenTree/templates/js/stock.js @@ -590,6 +590,11 @@ function loadStockTable(table, options) { return locationDetail(row); } }, + { + field: 'stocktake_date', + title: '{% trans "Stocktake" %}', + sortable: true, + }, {% settings_value "STOCK_ENABLE_EXPIRY" as expiry %} {% if expiry %} {