diff --git a/InvenTree/part/templates/part/stock.html b/InvenTree/part/templates/part/stock.html
index 96fd03e3cd..5bece01f2e 100644
--- a/InvenTree/part/templates/part/stock.html
+++ b/InvenTree/part/templates/part/stock.html
@@ -78,9 +78,15 @@
searchable: false,
sortable: true,
formatter: function(value, row, index, field) {
- return renderLink(value, row.url);
+ var text = renderLink(value, row.url)
+ text = text + "" + row.status + "";
+ return text;
}
- }
+ },
+ {
+ field: 'notes',
+ title: 'Notes',
+ },
],
url: "{% url 'api-stock-list' %}"
});
diff --git a/InvenTree/stock/migrations/0007_auto_20190417_1812.py b/InvenTree/stock/migrations/0007_auto_20190417_1812.py
new file mode 100644
index 0000000000..8b9ec638e3
--- /dev/null
+++ b/InvenTree/stock/migrations/0007_auto_20190417_1812.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2 on 2019-04-17 08:12
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('stock', '0006_stockitem_uuid'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='stockitem',
+ name='notes',
+ field=models.CharField(blank=True, help_text='Stock Item Notes', max_length=250),
+ ),
+ ]
diff --git a/InvenTree/stock/migrations/0008_auto_20190417_1819.py b/InvenTree/stock/migrations/0008_auto_20190417_1819.py
new file mode 100644
index 0000000000..46659abd66
--- /dev/null
+++ b/InvenTree/stock/migrations/0008_auto_20190417_1819.py
@@ -0,0 +1,20 @@
+# Generated by Django 2.2 on 2019-04-17 08:19
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('stock', '0007_auto_20190417_1812'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='stockitem',
+ name='stocktake_user',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stocktake_stock', to=settings.AUTH_USER_MODEL),
+ ),
+ ]
diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py
index 7731324622..6af5b3d4b7 100644
--- a/InvenTree/stock/models.py
+++ b/InvenTree/stock/models.py
@@ -163,7 +163,8 @@ class StockItem(models.Model):
# last time the stock was checked / counted
stocktake_date = models.DateField(blank=True, null=True)
- stocktake_user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
+ stocktake_user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True,
+ related_name='stocktake_stock')
review_needed = models.BooleanField(default=False)
@@ -184,7 +185,7 @@ class StockItem(models.Model):
choices=ITEM_STATUS_CODES.items(),
validators=[MinValueValidator(0)])
- notes = models.TextField(blank=True)
+ notes = models.CharField(max_length=250, blank=True, help_text='Stock Item Notes')
# If stock item is incoming, an (optional) ETA field
# expected_arrival = models.DateField(null=True, blank=True)
diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html
index 572f7b8e4b..f1f0a5db1d 100644
--- a/InvenTree/stock/templates/stock/item.html
+++ b/InvenTree/stock/templates/stock/item.html
@@ -20,7 +20,7 @@
Edit stock item
Move stock item
Add to stock
- Remove from stock
+ Take from stock
Stocktake
{% endif %}
Delete stock item
@@ -31,86 +31,95 @@
-{% qr_from_text item.uuid size="s" image_format="png" error_correction="L" %}
+
+
+
+
+ Part |
+ {{ item.part.name }} |
+
+
+ UUID |
+ {{ item.uuid }} |
+
+ {% if item.belongs_to %}
+
+ Belongs To |
+ {{ item.belongs_to }} |
+
+ {% elif item.location %}
+
+ Location |
+ {{ item.location.name }} |
+
+ {% endif %}
+ {% if item.serial %}
+
+ Serial |
+ {{ item.serial }} |
+
+ {% else %}
+
+ Quantity |
+ {{ item.quantity }} |
+
+ {% endif %}
+ {% if item.batch %}
+
+ Batch |
+ {{ item.batch }} |
+
+ {% endif %}
+ {% if item.customer %}
+
+ Customer |
+ {{ item.customer.name }} |
+
+ {% endif %}
+ {% if item.URL %}
+
+ URL |
+ {{ item.URL }} |
+
+ {% endif %}
+ {% if item.supplier_part %}
+
+ Supplier Part |
+ {{ item.supplier_part.SKU }} |
+
+ {% endif %}
+
+ Last Updated |
+ {{ item.updated }} |
+
+
+ Last Stocktake |
+ {% if item.stocktake_date %}
+ {{ item.stocktake_date }} {{ item.stocktake_user }} |
+ {% else %}
+ No stocktake performed |
+ {% endif %}
+
+
+ Status |
+ {{ item.get_status_display }} |
+
+ {% if item.notes %}
+
+ Notes |
+ {{ item.notes }} |
+
+ {% endif %}
+
+
+
+ {% qr_from_text item.uuid size="s" image_format="png" error_correction="L" %}
+
+
-
-
- Part |
- {{ item.part.name }} |
-
-
- UUID |
- {{ item.uuid }} |
-
-{% if item.belongs_to %}
-
- Belongs To |
- {{ item.belongs_to }} |
-
-{% elif item.location %}
-
- Location |
- {{ item.location.name }} |
-
-{% endif %}
-{% if item.serial %}
-
- Serial |
- {{ item.serial }} |
-
-{% else %}
-
- Quantity |
- {{ item.quantity }} |
-
-{% endif %}
-{% if item.batch %}
-
- Batch |
- {{ item.batch }} |
-
-{% endif %}
-{% if item.customer %}
-
- Customer |
- {{ item.customer.name }} |
-
-{% endif %}
-{% if item.URL %}
-
- URL |
- {{ item.URL }} |
-
-{% endif %}
-{% if item.supplier_part %}
-
- Supplier Part |
- {{ item.supplier_part.SKU }} |
-
-{% endif %}
-
- Updated |
- {{ item.updated }} |
-
-{% if item.stocktake_date %}
-
- Stocktake |
- {{ item.stocktake_date }} {{ item.stocktake_user }} |
-
-{% endif %}
-
- Status |
- {{ item.get_status_display }} |
-
-{% if item.notes %}
-
- Notes |
- {{ item.notes }} |
-
-{% endif %}
-
{% if item.has_tracking_info %}
+