# Generated by Django 3.1.4 on 2021-06-17 13:30

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0015_auto_20210428_1433'),
        ('company', '0212_companycfg_mes_inbound_qc_check_needed'),
        ('mes', '0020_auto_20210616_0912'),
    ]

    operations = [
        migrations.AddField(
            model_name='batch',
            name='vendors',
            field=models.JSONField(blank=True, default=list, null=True, verbose_name='供应商'),
        ),
        migrations.AddField(
            model_name='stkdetails',
            name='product',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messtkdetials_product', to='product.product', verbose_name='产成品'),
        ),
        migrations.AlterField(
            model_name='stkdetails',
            name='materials',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messtkdetials_materials', to='mes.materials', verbose_name='原材料'),
        ),
        migrations.AlterField(
            model_name='stkdetails',
            name='packaging',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messtkdetials_packaging', to='mes.packaging', verbose_name='包装材料'),
        ),
        migrations.AlterField(
            model_name='stkdetails',
            name='semifinishedgoods',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messtkdetials_semifinishedgoods', to='mes.semifinishedgoods', verbose_name='半成品'),
        ),
        migrations.CreateModel(
            name='Vendor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='供应商名称')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='详细地址')),
                ('cellphone', models.CharField(blank=True, max_length=20, null=True, verbose_name='联系电话')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vendor_company', to='company.company', verbose_name='企业名称')),
            ],
            options={
                'verbose_name': '供应商',
                'verbose_name_plural': '供应商',
                'unique_together': {('company', 'name')},
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='客户名称')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='详细地址')),
                ('cellphone', models.CharField(blank=True, max_length=20, null=True, verbose_name='联系电话')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customer_company', to='company.company', verbose_name='企业名称')),
            ],
            options={
                'verbose_name': '代工客户',
                'verbose_name_plural': '代工客户',
                'unique_together': {('company', 'name')},
            },
        ),
    ]
