diff --git a/apps/wpm/migrations/0120_alter_batchst_data.py b/apps/wpm/migrations/0120_alter_batchst_data.py new file mode 100644 index 00000000..bcfb31b7 --- /dev/null +++ b/apps/wpm/migrations/0120_alter_batchst_data.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2025-07-17 02:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wpm', '0119_mlogb_route'), + ] + + operations = [ + migrations.AlterField( + model_name='batchst', + name='data', + field=models.JSONField(blank=True, default=dict, verbose_name='数据'), + ), + ] diff --git a/apps/wpm/models.py b/apps/wpm/models.py index 13c397fa..7dba96c7 100644 --- a/apps/wpm/models.py +++ b/apps/wpm/models.py @@ -648,7 +648,7 @@ class BatchSt(BaseModel): version = models.IntegerField("版本号", default=1, db_index=True) first_time = models.DateTimeField("首次操作时间", null=True, blank=True) last_time = models.DateTimeField("最后操作时间", null=True, blank=True) - data = models.JSONField("数据", default=list, blank=True) + data = models.JSONField("数据", default=dict, blank=True) material_start = models.ForeignKey(Material, verbose_name="起始物料", on_delete=models.SET_NULL, null=True, blank=True) mio = models.ForeignKey("inm.mio", verbose_name="由何出入库记录创建", on_delete=models.CASCADE, null=True, blank=True) mioitem = models.ForeignKey("inm.mioitem", verbose_name="由何出入库记录明细创建", on_delete=models.CASCADE, null=True, blank=True)