feat: 移除material count字段
This commit is contained in:
parent
2da918dbdf
commit
8bfc630919
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Generated by Django 3.2.12 on 2025-11-06 15:38
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mtm', '0062_auto_20250902_1122'),
|
||||||
|
('inm', '0036_mioitem_pack_index'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='materialbatch',
|
||||||
|
name='material',
|
||||||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mb_m', to='mtm.material', verbose_name='物料'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -25,7 +25,7 @@ class MaterialBatch(BaseModel):
|
||||||
batch = models.TextField('批次号', db_index=True)
|
batch = models.TextField('批次号', db_index=True)
|
||||||
state = models.PositiveSmallIntegerField('状态', default=10, choices=((10, '合格'), (20, '不合格'), (30, '返修'), (40, '检验'), (50, '报废')))
|
state = models.PositiveSmallIntegerField('状态', default=10, choices=((10, '合格'), (20, '不合格'), (30, '返修'), (40, '检验'), (50, '报废')))
|
||||||
material = models.ForeignKey(
|
material = models.ForeignKey(
|
||||||
Material, on_delete=models.CASCADE, verbose_name='物料')
|
Material, on_delete=models.CASCADE, verbose_name='物料', related_name="mb_m")
|
||||||
warehouse = models.ForeignKey(
|
warehouse = models.ForeignKey(
|
||||||
WareHouse, on_delete=models.CASCADE, verbose_name='所在仓库')
|
WareHouse, on_delete=models.CASCADE, verbose_name='所在仓库')
|
||||||
count = models.DecimalField('存量', max_digits=12, decimal_places=3, default=0)
|
count = models.DecimalField('存量', max_digits=12, decimal_places=3, default=0)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ class MaterialFilter(filters.FilterSet):
|
||||||
"orderitem_material__order": ['exact'],
|
"orderitem_material__order": ['exact'],
|
||||||
"pu_orderitem_material__pu_order": ["exact"],
|
"pu_orderitem_material__pu_order": ["exact"],
|
||||||
"route_material_out__mgroup": ["exact"],
|
"route_material_out__mgroup": ["exact"],
|
||||||
"count": ["gte", "lte", "exact", "gt", "lt"],
|
|
||||||
"count_safe": ["gte", "lte", "exact", "gt", "lt"]
|
"count_safe": ["gte", "lte", "exact", "gt", "lt"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Generated by Django 3.2.12 on 2025-11-06 15:39
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mtm', '0062_auto_20250902_1122'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='material',
|
||||||
|
name='count',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='material',
|
||||||
|
name='count_mb',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='material',
|
||||||
|
name='count_wm',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -93,9 +93,9 @@ class Material(CommonAModel):
|
||||||
tracking = models.PositiveSmallIntegerField("追踪方式", default=10,
|
tracking = models.PositiveSmallIntegerField("追踪方式", default=10,
|
||||||
choices=((MA_TRACKING_BATCH, '批次'),
|
choices=((MA_TRACKING_BATCH, '批次'),
|
||||||
(MA_TRACKING_SINGLE, '单件')))
|
(MA_TRACKING_SINGLE, '单件')))
|
||||||
count = models.DecimalField('总库存', max_digits=14, decimal_places=3, default=0)
|
# count = models.DecimalField('总库存', max_digits=14, decimal_places=3, default=0)
|
||||||
count_mb = 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_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)
|
||||||
week_esitimate_consume = 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 = models.ForeignKey(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue