From 556d6455e8dff440e58e74f5787a81a009c6083d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 19 Feb 2021 11:08:58 +1100 Subject: [PATCH] Add "packaging" field for StockItem --- .../migrations/0058_stockitem_packaging.py | 18 ++++++++++++++++++ InvenTree/stock/models.py | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 InvenTree/stock/migrations/0058_stockitem_packaging.py diff --git a/InvenTree/stock/migrations/0058_stockitem_packaging.py b/InvenTree/stock/migrations/0058_stockitem_packaging.py new file mode 100644 index 0000000000..ee33724588 --- /dev/null +++ b/InvenTree/stock/migrations/0058_stockitem_packaging.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2021-02-19 00:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0057_stock_location_item_owner'), + ] + + operations = [ + migrations.AddField( + model_name='stockitem', + name='packaging', + field=models.CharField(blank=True, help_text='Packaging this stock item is stored in', max_length=50, null=True, verbose_name='Packaging'), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 84cc696593..5088a314b5 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -155,6 +155,7 @@ class StockItem(MPTTModel): infinite: If True this StockItem can never be exhausted sales_order: Link to a SalesOrder object (if the StockItem has been assigned to a SalesOrder) purchase_price: The unit purchase price for this StockItem - this is the unit price at time of purchase (if this item was purchased from an external supplier) + packaging: Description of how the StockItem is packaged (e.g. "reel", "loose", "tape" etc) """ # A Query filter which will be re-used in multiple places to determine if a StockItem is actually "in stock" @@ -387,6 +388,13 @@ class StockItem(MPTTModel): help_text=_('Where is this stock item located?') ) + packaging = models.CharField( + max_length=50, + blank=True, null=True, + verbose_name=_('Packaging'), + help_text=_('Packaging this stock item is stored in') + ) + belongs_to = models.ForeignKey( 'self', verbose_name=_('Installed In'),