diff --git a/apps/inm/migrations/0037_alter_materialbatch_material.py b/apps/inm/migrations/0037_alter_materialbatch_material.py new file mode 100644 index 00000000..61868b24 --- /dev/null +++ b/apps/inm/migrations/0037_alter_materialbatch_material.py @@ -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='物料'), + ), + ] diff --git a/apps/inm/models.py b/apps/inm/models.py index 6477a693..83580b49 100644 --- a/apps/inm/models.py +++ b/apps/inm/models.py @@ -25,7 +25,7 @@ class MaterialBatch(BaseModel): batch = models.TextField('批次号', db_index=True) state = models.PositiveSmallIntegerField('状态', default=10, choices=((10, '合格'), (20, '不合格'), (30, '返修'), (40, '检验'), (50, '报废'))) 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, on_delete=models.CASCADE, verbose_name='所在仓库') count = models.DecimalField('存量', max_digits=12, decimal_places=3, default=0) diff --git a/apps/mtm/filters.py b/apps/mtm/filters.py index df1a9e9e..72be6443 100644 --- a/apps/mtm/filters.py +++ b/apps/mtm/filters.py @@ -22,7 +22,6 @@ class MaterialFilter(filters.FilterSet): "orderitem_material__order": ['exact'], "pu_orderitem_material__pu_order": ["exact"], "route_material_out__mgroup": ["exact"], - "count": ["gte", "lte", "exact", "gt", "lt"], "count_safe": ["gte", "lte", "exact", "gt", "lt"] } diff --git a/apps/mtm/migrations/0063_auto_20251106_2339.py b/apps/mtm/migrations/0063_auto_20251106_2339.py new file mode 100644 index 00000000..7c56ec87 --- /dev/null +++ b/apps/mtm/migrations/0063_auto_20251106_2339.py @@ -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', + ), + ] diff --git a/apps/mtm/models.py b/apps/mtm/models.py index a82dcdb3..d68d90e0 100644 --- a/apps/mtm/models.py +++ b/apps/mtm/models.py @@ -93,9 +93,9 @@ class Material(CommonAModel): tracking = models.PositiveSmallIntegerField("追踪方式", default=10, choices=((MA_TRACKING_BATCH, '批次'), (MA_TRACKING_SINGLE, '单件'))) - 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 = 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) week_esitimate_consume = models.DecimalField('周消耗预估', max_digits=14, decimal_places=3, null=True, blank=True) process = models.ForeignKey(