From 7fd47c2a97f122f67f9ec387f6a0a2c986c9e651 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 17 Jul 2025 10:20:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9batchst=20data?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=BAdict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/migrations/0120_alter_batchst_data.py | 18 ++++++++++++++++++ apps/wpm/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 apps/wpm/migrations/0120_alter_batchst_data.py 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)