Add a 'uid' field to StockItem model

- To be used for barcode asociation and lookup
This commit is contained in:
Oliver Walters 2020-04-14 22:54:05 +10:00
parent 277b28a7e9
commit ba4a1fd771
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.10 on 2020-04-14 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0025_auto_20200405_2243'),
]
operations = [
migrations.AddField(
model_name='stockitem',
name='uid',
field=models.CharField(blank=True, help_text='Unique identifier field', max_length=128),
),
]

View File

@ -108,6 +108,7 @@ class StockItem(MPTTModel):
Attributes: Attributes:
parent: Link to another StockItem from which this StockItem was created parent: Link to another StockItem from which this StockItem was created
uid: Field containing a unique-id which is mapped to a third-party identifier (e.g. a barcode)
part: Link to the master abstract part that this StockItem is an instance of part: Link to the master abstract part that this StockItem is an instance of
supplier_part: Link to a specific SupplierPart (optional) supplier_part: Link to a specific SupplierPart (optional)
location: Where this StockItem is located location: Where this StockItem is located
@ -295,6 +296,8 @@ class StockItem(MPTTModel):
} }
) )
uid = models.CharField(blank=True, max_length=128, help_text=("Unique identifier field"))
parent = TreeForeignKey('self', parent = TreeForeignKey('self',
on_delete=models.DO_NOTHING, on_delete=models.DO_NOTHING,
blank=True, null=True, blank=True, null=True,