From 3c0088d18fca551d03cce4eca71ecd80f8e2c840 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 14 Jul 2026 15:19:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=BA=93=E5=AD=98=E4=B8=8A=E9=99=90=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=B9=B6=E6=94=AF=E6=8C=81=E4=BB=93=E5=BA=93=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=B1=87=E6=80=BB=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mtm_material 新增 count_safe_upper(安全库存上限), count_safe 语义明确为下限 - 迁移 0065 Co-Authored-By: Claude Opus 4.8 (1M context) --- ...nt_safe_upper_alter_material_count_safe.py | 23 +++++++++++++++++++ apps/mtm/models.py | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 apps/mtm/migrations/0065_material_count_safe_upper_alter_material_count_safe.py diff --git a/apps/mtm/migrations/0065_material_count_safe_upper_alter_material_count_safe.py b/apps/mtm/migrations/0065_material_count_safe_upper_alter_material_count_safe.py new file mode 100644 index 00000000..479d1dfe --- /dev/null +++ b/apps/mtm/migrations/0065_material_count_safe_upper_alter_material_count_safe.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.27 on 2026-07-14 06:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mtm', '0064_process_clear_defect'), + ] + + operations = [ + migrations.AddField( + model_name='material', + name='count_safe_upper', + field=models.DecimalField(blank=True, decimal_places=3, max_digits=14, null=True, verbose_name='安全库存上限'), + ), + migrations.AlterField( + model_name='material', + name='count_safe', + field=models.DecimalField(blank=True, decimal_places=3, max_digits=14, null=True, verbose_name='安全库存数(下限)'), + ), + ] diff --git a/apps/mtm/models.py b/apps/mtm/models.py index 82a17ebc..dc935c44 100644 --- a/apps/mtm/models.py +++ b/apps/mtm/models.py @@ -98,7 +98,8 @@ class Material(CommonAModel): # count = models.DecimalField('总库存', max_digits=14, decimal_places=3, default=0) # count_mb = models.DecimalField('仓库库存', max_digits=14, decimal_places=3, default=0) # count_wm = models.DecimalField('车间库存', max_digits=14, decimal_places=3, default=0) - count_safe = models.DecimalField('安全库存数', max_digits=14, decimal_places=3, null=True, blank=True) + count_safe = models.DecimalField('安全库存数(下限)', max_digits=14, decimal_places=3, null=True, blank=True) + count_safe_upper = models.DecimalField('安全库存上限', max_digits=14, decimal_places=3, null=True, blank=True) week_esitimate_consume = models.DecimalField('周消耗预估', max_digits=14, decimal_places=3, null=True, blank=True) process = models.ForeignKey( Process, verbose_name='所用工序', on_delete=models.CASCADE, null=True, blank=True)