diff --git a/InvenTree/stock/forms.py b/InvenTree/stock/forms.py index 51655b4182..c7defebaa3 100644 --- a/InvenTree/stock/forms.py +++ b/InvenTree/stock/forms.py @@ -49,5 +49,6 @@ class EditStockItemForm(forms.ModelForm): 'batch', 'quantity', 'status', - 'customer' + 'customer', + 'URL', ] diff --git a/InvenTree/stock/migrations/0008_stockitem_url.py b/InvenTree/stock/migrations/0008_stockitem_url.py new file mode 100644 index 0000000000..93e79fb4e9 --- /dev/null +++ b/InvenTree/stock/migrations/0008_stockitem_url.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11 on 2018-04-16 11:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0007_auto_20180416_0853'), + ] + + operations = [ + migrations.AddField( + model_name='stockitem', + name='URL', + field=models.URLField(blank=True, max_length=125), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 689a04523c..8d0f01a409 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -80,6 +80,9 @@ class StockItem(models.Model): # Optional serial number serial = models.PositiveIntegerField(blank=True, null=True) + # Optional URL to link to external resource + URL = models.URLField(max_length=125, blank=True) + # Optional batch information batch = models.CharField(max_length=100, blank=True) diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index 7266e692f4..65394d623d 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -44,6 +44,12 @@