diff --git a/InvenTree/part/forms.py b/InvenTree/part/forms.py
index 2eb9600065..6430ac922b 100644
--- a/InvenTree/part/forms.py
+++ b/InvenTree/part/forms.py
@@ -101,11 +101,6 @@ class EditPartForm(HelperForm):
'default_supplier',
'units',
'minimum_stock',
- 'assembly',
- 'component',
- 'trackable',
- 'purchaseable',
- 'salable',
'notes',
]
diff --git a/InvenTree/part/migrations/0009_part_virtual.py b/InvenTree/part/migrations/0009_part_virtual.py
new file mode 100644
index 0000000000..8a934e9064
--- /dev/null
+++ b/InvenTree/part/migrations/0009_part_virtual.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.2 on 2019-06-18 08:33
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('part', '0008_auto_20190618_0042'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='part',
+ name='virtual',
+ field=models.BooleanField(default=False, help_text='Is this a virtual part, such as a software product or license?'),
+ ),
+ ]
diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py
index 7d5476db5d..92acce5026 100644
--- a/InvenTree/part/models.py
+++ b/InvenTree/part/models.py
@@ -216,6 +216,7 @@ class Part(models.Model):
purchaseable: Can this part be purchased from suppliers?
trackable: Trackable parts can have unique serial numbers assigned, etc, etc
active: Is this part active? Parts are deactivated instead of being deleted
+ virtual: Is this part "virtual"? e.g. a software product or similar
notes: Additional notes field for this part
"""
@@ -377,6 +378,8 @@ class Part(models.Model):
active = models.BooleanField(default=True, help_text='Is this part active?')
+ virtual = models.BooleanField(default=False, help_text='Is this a virtual part, such as a software product or license?')
+
notes = models.TextField(blank=True)
bom_checksum = models.CharField(max_length=128, blank=True, help_text='Stored BOM checksum')
diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py
index 36be5de6db..eaea7ecebc 100644
--- a/InvenTree/part/serializers.py
+++ b/InvenTree/part/serializers.py
@@ -100,8 +100,10 @@ class PartSerializer(InvenTreeModelSerializer):
'assembly',
'component',
'trackable',
+ 'purchaseable',
'salable',
'active',
+ 'virtual',
]
diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html
index fe357a6bdc..fe07954a5a 100644
--- a/InvenTree/part/templates/part/detail.html
+++ b/InvenTree/part/templates/part/detail.html
@@ -6,7 +6,6 @@
-
Part Details
@@ -30,10 +29,9 @@
-
-
+
Part Details
Part name
@@ -102,37 +100,62 @@
+
Part Type
- {% if part.assembly %}
-
Assembly
-
This part can be assembled from other parts
+
Virtual
+
{% include "slide.html" with state=part.virtual field='virtual' %}
+ {% if part.virtual %}
+
Part is virtual (not a physical part)
+ {% else %}
+
Part is not a virtual part
+ {% endif %}
+
+
+
Assembly
+
{% include "slide.html" with state=part.assembly field='assembly' %}
+ {% if part.assembly %}
+
Part can be assembled from other parts
+ {% else %}
+
Part cannot be assembled from other parts
+ {% endif %}
- {% endif %}
- {% if part.component %}
Component
-
This part can be used in assemblies
+
{% include "slide.html" with state=part.component field='component' %}
+ {% if part.component %}
+
Part can be used in assemblies
+ {% else %}
+
Part cannot be used in assemblies
+ {% endif %}
- {% endif %}
- {% if part.trackable %}
Trackable
-
Stock for this part will be tracked by (serial or batch)
+
{% include "slide.html" with state=part.trackable field='trackable' %}
+ {% if part.trackable %}
+
Part stock will be tracked by (serial or batch)
+ {% else %}
+
Part stock will not be tracked by
+ {% endif %}
- {% endif %}
- {% if part.purchaseable %}
Purchaseable
-
This part can be purchased from external suppliers
+
{% include "slide.html" with state=part.purchaseable field='purchaseable' %}
+ {% if part.purchaseable %}
+
Part can be purchased from external suppliers
+ {% else %}
+
Part can be purchased from external suppliers
+ {% endif %}
- {% endif %}
- {% if part.salable %}
-
Salable
-
This part can be sold to customers
+
Sellable
+
{% include "slide.html" with state=part.salable field='salable' %}