diff --git a/InvenTree/InvenTree/static/script/inventree/stock.js b/InvenTree/InvenTree/static/script/inventree/stock.js index ef8e5ab761..e21971bb0f 100644 --- a/InvenTree/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/InvenTree/static/script/inventree/stock.js @@ -230,10 +230,6 @@ function loadStockTable(table, options) { } html = imageHoverIcon(thumb) + renderLink(name, url); - - if (row.allocated) { - html += ``; - } return html; } @@ -261,9 +257,18 @@ function loadStockTable(table, options) { val = +val.toFixed(5); } - var text = renderLink(val, '/stock/item/' + row.pk + '/'); + var html = renderLink(val, `/stock/item/${row.pk}/`); - return text; + if (row.allocated) { + html += ``; + } + + // 70 = "LOST" + if (row.status == 70) { + html += ``; + } + + return html; } }, { diff --git a/InvenTree/stock/migrations/0030_auto_20200422_0015.py b/InvenTree/stock/migrations/0030_auto_20200422_0015.py new file mode 100644 index 0000000000..c720ac48ef --- /dev/null +++ b/InvenTree/stock/migrations/0030_auto_20200422_0015.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.5 on 2020-04-22 00:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('order', '0023_auto_20200420_2309'), + ('stock', '0029_auto_20200421_2359'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='sales_order_line', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_items', to='order.SalesOrderLineItem'), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index a29018fb88..61683a361f 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -373,7 +373,7 @@ class StockItem(MPTTModel): SalesOrderLineItem, on_delete=models.SET_NULL, related_name='stock_items', - null=True) + null=True, blank=True) # last time the stock was checked / counted stocktake_date = models.DateField(blank=True, null=True)