Merge pull request #916 from SchrodingersGat/null-customer

StockItem: Allow customer field to be blank
This commit is contained in:
Oliver 2020-08-20 14:59:06 +10:00 committed by GitHub
commit 852a680c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# Generated by Django 3.0.7 on 2020-08-20 04:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0023_auto_20200808_0715'),
('stock', '0048_auto_20200807_2344'),
]
operations = [
migrations.AlterField(
model_name='stockitem',
name='customer',
field=models.ForeignKey(blank=True, 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'),
),
]

View File

@ -348,7 +348,7 @@ class StockItem(MPTTModel):
customer = models.ForeignKey(
CompanyModels.Company,
on_delete=models.SET_NULL,
null=True,
null=True, blank=True,
limit_choices_to={'is_customer': True},
related_name='assigned_stock',
help_text=_("Customer"),