feat:新增物料安全库存上限字段并支持仓库数量汇总报表

- mtm_material 新增 count_safe_upper(安全库存上限), count_safe 语义明确为下限
- 迁移 0065

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-07-14 15:19:27 +08:00
parent d68ca98f2c
commit 3c0088d18f
2 changed files with 25 additions and 1 deletions

View File

@ -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='安全库存数(下限)'),
),
]

View File

@ -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)