Add "is_building" field to StockItem model

- This will be set to TRUE until a stock item has been completed
This commit is contained in:
Oliver Walters 2020-10-05 00:12:42 +11:00
parent 7f3ce9b0b1
commit ee28b4eea5
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2020-10-04 13:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0051_auto_20200928_0928'),
]
operations = [
migrations.AddField(
model_name='stockitem',
name='is_building',
field=models.BooleanField(default=False),
),
]

View File

@ -130,6 +130,7 @@ class StockItem(MPTTModel):
status: Status of this StockItem (ref: InvenTree.status_codes.StockStatus)
notes: Extra notes field
build: Link to a Build (if this stock item was created from a build)
is_building: Boolean field indicating if this stock item is currently being built
purchase_order: Link to a PurchaseOrder (if this stock item was created from a PurchaseOrder)
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)
@ -389,6 +390,10 @@ class StockItem(MPTTModel):
related_name='build_outputs',
)
is_building = models.BooleanField(
default=False,
)
purchase_order = models.ForeignKey(
'order.PurchaseOrder',
on_delete=models.SET_NULL,