# Generated by Django 3.2.6 on 2021-10-25 07:33

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('mtm', '0025_outputmaterial_is_main'),
        ('pm', '0007_auto_20211025_1533'),
        ('inm', '0004_auto_20210929_0842'),
    ]

    operations = [
        migrations.AddField(
            model_name='fifo',
            name='inout_date',
            field=models.DateField(default=django.utils.timezone.now, verbose_name='出入库日期'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fifo',
            name='operator',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='system.user', verbose_name='操作人'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fifo',
            name='subproduction_plan',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='pm.subproductionplan', verbose_name='关联子生产计划'),
        ),
        migrations.AddField(
            model_name='fifo',
            name='warehouse',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='inm.warehouse', verbose_name='仓库'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='materialbatch',
            name='batch',
            field=models.CharField(blank=True, max_length=100, null=True, unique=True, verbose_name='批次号'),
        ),
        migrations.CreateModel(
            name='IProduct',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('state', models.IntegerField(default=1, verbose_name='物品状态')),
                ('number', models.CharField(blank=True, max_length=50, null=True, unique=True, verbose_name='物品编号')),
                ('batch', models.CharField(blank=True, max_length=100, null=True, verbose_name='所属批次号')),
                ('fifos', models.JSONField(blank=True, default=list, verbose_name='关联出入库记录')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='iproduct_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mtm.material', verbose_name='物料类型')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='iproduct_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
                ('warehouse', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inm.warehouse', verbose_name='所在仓库')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FIFODetail',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('count', models.IntegerField(default=0, verbose_name='数量')),
                ('batch', models.CharField(blank=True, max_length=100, null=True, verbose_name='批次号')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fifodetail_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mtm.material', verbose_name='物料类型')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fifodetail_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
