diff --git a/hb_server/apps/inm/migrations/0012_auto_20211110_1413.py b/hb_server/apps/inm/migrations/0012_auto_20211110_1413.py new file mode 100644 index 0000000..c34a020 --- /dev/null +++ b/hb_server/apps/inm/migrations/0012_auto_20211110_1413.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.6 on 2021-11-10 06:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('inm', '0011_rename_fifodetail_fifoitem'), + ] + + operations = [ + migrations.AlterField( + model_name='fifoitem', + name='batch', + field=models.CharField(default='', max_length=100, verbose_name='批次号'), + ), + migrations.AlterField( + model_name='iproduct', + name='batch', + field=models.CharField(default='', max_length=100, verbose_name='所属批次号'), + ), + ] diff --git a/hb_server/apps/inm/migrations/0013_alter_materialbatch_batch.py b/hb_server/apps/inm/migrations/0013_alter_materialbatch_batch.py new file mode 100644 index 0000000..55fac10 --- /dev/null +++ b/hb_server/apps/inm/migrations/0013_alter_materialbatch_batch.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.6 on 2021-11-10 06:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('inm', '0012_auto_20211110_1413'), + ] + + operations = [ + migrations.AlterField( + model_name='materialbatch', + name='batch', + field=models.CharField(default='', max_length=100, verbose_name='批次号'), + ), + ] diff --git a/hb_server/apps/inm/models.py b/hb_server/apps/inm/models.py index 8446014..40da0d2 100644 --- a/hb_server/apps/inm/models.py +++ b/hb_server/apps/inm/models.py @@ -41,7 +41,7 @@ class MaterialBatch(BaseModel): material = models.ForeignKey(Material, on_delete=models.CASCADE, verbose_name='物料信息') warehouse = models.ForeignKey(WareHouse, on_delete=models.CASCADE, verbose_name='所在仓库') count = models.IntegerField('存量', default=0) - batch = models.CharField('批次号', max_length=100, null=True, blank=True) + batch = models.CharField('批次号', max_length=100, default='') expiration_date = models.DateField('有效期', null=True, blank=True) class Meta: verbose_name = '库存表' @@ -80,7 +80,7 @@ class FIFOItem(BaseModel): is_testok = models.BooleanField('是否检测合格', default=False) material = models.ForeignKey(Material, verbose_name='物料类型', on_delete=models.CASCADE) count = models.IntegerField('数量', default=0) - batch = models.CharField('批次号', max_length=100, null=True, blank=True) + batch = models.CharField('批次号', max_length=100, default='') fifo = models.ForeignKey(FIFO, verbose_name='关联出入库', on_delete=models.CASCADE) @@ -97,7 +97,7 @@ class IProduct(BaseModel): number = models.CharField('物品编号', unique=True, null=True, blank=True, max_length=50) material = models.ForeignKey(Material, verbose_name='物料类型', on_delete=models.CASCADE) warehouse = models.ForeignKey(WareHouse, on_delete=models.CASCADE, verbose_name='所在仓库') - batch = models.CharField('所属批次号', max_length=100, null=True, blank=True) + batch = models.CharField('所属批次号', max_length=100, default='') wproduct = models.ForeignKey('wpm.wproduct', on_delete=models.CASCADE, verbose_name='关联的动态产品', db_constraint=False, null=True, blank=True) fifos = models.JSONField('关联出入库记录', default=list, blank=True) diff --git a/hb_server/apps/wpm/serializers.py b/hb_server/apps/wpm/serializers.py index a2f3be0..0e27b56 100644 --- a/hb_server/apps/wpm/serializers.py +++ b/hb_server/apps/wpm/serializers.py @@ -14,7 +14,7 @@ from django.db import transaction class PickDetailSerializer(serializers.Serializer): material = serializers.PrimaryKeyRelatedField(queryset=Material.objects.all(), label="物料ID") - batch = serializers.CharField(label='物料批次', required=False) + batch = serializers.CharField(label='物料批次', allow_blank=True) pick_count = serializers.IntegerField(label="领料数量") class PickSerializer(serializers.Serializer): @@ -173,7 +173,7 @@ class OperationSubmitSerializer(serializers.Serializer): input = DoInputSerializer(many=True, required=False) output = DoOutputSerializer(many=True, required=False) forms = OperationRecordSerializer(many=True, required=False) - remark = serializers.CharField(required=False, label='操作备注') + remark = serializers.CharField(required=False, label='操作备注', allow_blank=True, allow_null=True) \ No newline at end of file