diff --git a/InvenTree/InvenTree/static/script/inventree/stock.js b/InvenTree/InvenTree/static/script/inventree/stock.js
index 268b8ed42f..73a97b0b63 100644
--- a/InvenTree/InvenTree/static/script/inventree/stock.js
+++ b/InvenTree/InvenTree/static/script/inventree/stock.js
@@ -308,6 +308,10 @@ function loadStockTrackingTable(table, options) {
html += "
" + row.notes + "";
}
+ if (row.URL) {
+ html += "
" + row.URL + "";
+ }
+
return html;
}
});
diff --git a/InvenTree/stock/forms.py b/InvenTree/stock/forms.py
index d7d74e45de..d1fd841612 100644
--- a/InvenTree/stock/forms.py
+++ b/InvenTree/stock/forms.py
@@ -8,7 +8,7 @@ from __future__ import unicode_literals
from django import forms
from InvenTree.forms import HelperForm
-from .models import StockLocation, StockItem
+from .models import StockLocation, StockItem, StockItemTracking
class EditStockLocationForm(HelperForm):
@@ -104,3 +104,17 @@ class EditStockItemForm(HelperForm):
'notes',
'URL',
]
+
+
+class TrackingEntryForm(HelperForm):
+ """ Form for creating / editing a StockItemTracking object.
+ """
+
+ class Meta:
+ model = StockItemTracking
+
+ fields = [
+ 'title',
+ 'notes',
+ 'URL',
+ ]
diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py
index 53abe2de95..11a588075d 100644
--- a/InvenTree/stock/models.py
+++ b/InvenTree/stock/models.py
@@ -298,7 +298,7 @@ class StockItem(models.Model):
def has_tracking_info(self):
return self.tracking_info.count() > 0
- def addTransactionNote(self, title, user, notes='', system=True):
+ def addTransactionNote(self, title, user, notes='', url='', system=True):
""" Generation a stock transaction note for this item.
Brief automated note detailing a movement or quantity change.
@@ -310,6 +310,7 @@ class StockItem(models.Model):
quantity=self.quantity,
date=datetime.now().date(),
notes=notes,
+ URL=url,
system=system
)
diff --git a/InvenTree/stock/serializers.py b/InvenTree/stock/serializers.py
index 4ec0530bf4..14fe043564 100644
--- a/InvenTree/stock/serializers.py
+++ b/InvenTree/stock/serializers.py
@@ -149,6 +149,7 @@ class StockTrackingSerializer(InvenTreeModelSerializer):
'date',
'title',
'notes',
+ 'URL',
'quantity',
'user',
'system',
diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html
index 28c54965bc..f6847d5ae1 100644
--- a/InvenTree/stock/templates/stock/item.html
+++ b/InvenTree/stock/templates/stock/item.html
@@ -125,19 +125,29 @@
-
-{% if item.has_tracking_info %}