mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a reference to a build for a stock item
This commit is contained in:
parent
c63d40bd88
commit
90a342fad8
20
InvenTree/stock/migrations/0010_stockitem_build.py
Normal file
20
InvenTree/stock/migrations/0010_stockitem_build.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 2.2.4 on 2019-09-01 13:08
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('build', '0005_auto_20190604_2217'),
|
||||||
|
('stock', '0009_auto_20190715_2351'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='stockitem',
|
||||||
|
name='build',
|
||||||
|
field=models.ForeignKey(blank=True, help_text='Build for this stock item', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='build_outputs', to='build.Build'),
|
||||||
|
),
|
||||||
|
]
|
@ -101,6 +101,7 @@ class StockItem(models.Model):
|
|||||||
delete_on_deplete: If True, StockItem will be deleted when the stock level gets to zero
|
delete_on_deplete: If True, StockItem will be deleted when the stock level gets to zero
|
||||||
status: Status of this StockItem (ref: InvenTree.status_codes.StockStatus)
|
status: Status of this StockItem (ref: InvenTree.status_codes.StockStatus)
|
||||||
notes: Extra notes field
|
notes: Extra notes field
|
||||||
|
build: Link to a Build (if this stock item was created from a build)
|
||||||
purchase_order: Link to a PurchaseOrder (if this stock item was created from a PurchaseOrder)
|
purchase_order: Link to a PurchaseOrder (if this stock item was created from a PurchaseOrder)
|
||||||
infinite: If True this StockItem can never be exhausted
|
infinite: If True this StockItem can never be exhausted
|
||||||
"""
|
"""
|
||||||
@ -300,6 +301,13 @@ class StockItem(models.Model):
|
|||||||
|
|
||||||
updated = models.DateField(auto_now=True, null=True)
|
updated = models.DateField(auto_now=True, null=True)
|
||||||
|
|
||||||
|
build = models.ForeignKey(
|
||||||
|
'build.Build', on_delete=models.SET_NULL,
|
||||||
|
blank=True, null=True,
|
||||||
|
help_text='Build for this stock item',
|
||||||
|
related_name='build_outputs',
|
||||||
|
)
|
||||||
|
|
||||||
purchase_order = models.ForeignKey(
|
purchase_order = models.ForeignKey(
|
||||||
'order.PurchaseOrder',
|
'order.PurchaseOrder',
|
||||||
on_delete=models.SET_NULL,
|
on_delete=models.SET_NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user