mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add 'customer' field to StockItem
This commit is contained in:
parent
4ddabb82ef
commit
fbd21827fb
20
InvenTree/stock/migrations/0045_stockitem_customer.py
Normal file
20
InvenTree/stock/migrations/0045_stockitem_customer.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.0.5 on 2020-06-04 03:20
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('company', '0021_remove_supplierpart_manufacturer_name'),
|
||||
('stock', '0044_auto_20200528_1036'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='stockitem',
|
||||
name='customer',
|
||||
field=models.ForeignKey(help_text='Customer', limit_choices_to={'is_customer': True}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_stock', to='company.Company', verbose_name='Customer'),
|
||||
),
|
||||
]
|
@ -32,6 +32,7 @@ from InvenTree.status_codes import StockStatus
|
||||
from InvenTree.models import InvenTreeTree, InvenTreeAttachment
|
||||
from InvenTree.fields import InvenTreeURLField
|
||||
|
||||
from company import models as CompanyModels
|
||||
from part import models as PartModels
|
||||
|
||||
|
||||
@ -352,6 +353,16 @@ class StockItem(MPTTModel):
|
||||
help_text=_('Is this item installed in another item?')
|
||||
)
|
||||
|
||||
customer = models.ForeignKey(
|
||||
CompanyModels.Company,
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
limit_choices_to={'is_customer': True},
|
||||
related_name='assigned_stock',
|
||||
help_text=_("Customer"),
|
||||
verbose_name=_("Customer"),
|
||||
)
|
||||
|
||||
serial = models.PositiveIntegerField(
|
||||
verbose_name=_('Serial Number'),
|
||||
blank=True, null=True,
|
||||
|
Loading…
Reference in New Issue
Block a user