diff --git a/hb_server/apps/mtm/migrations/0020_auto_20211012_1657.py b/hb_server/apps/mtm/migrations/0020_auto_20211012_1657.py new file mode 100644 index 0000000..2d80438 --- /dev/null +++ b/hb_server/apps/mtm/migrations/0020_auto_20211012_1657.py @@ -0,0 +1,26 @@ +# Generated by Django 3.2.6 on 2021-10-12 08:57 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('mtm', '0019_auto_20211012_0901'), + ] + + operations = [ + migrations.AddField( + model_name='subproduction', + name='create_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='subproduction_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人'), + ), + migrations.AddField( + model_name='subproduction', + name='update_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='subproduction_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人'), + ), + ] diff --git a/hb_server/apps/mtm/models.py b/hb_server/apps/mtm/models.py index 1037796..4574713 100644 --- a/hb_server/apps/mtm/models.py +++ b/hb_server/apps/mtm/models.py @@ -128,7 +128,7 @@ class RecordFormField(CommonAModel): -class SubProduction(BaseModel): +class SubProduction(CommonAModel): """ 产品生产分解 """ diff --git a/hb_server/apps/mtm/views.py b/hb_server/apps/mtm/views.py index 96ecf06..7c63a27 100644 --- a/hb_server/apps/mtm/views.py +++ b/hb_server/apps/mtm/views.py @@ -69,7 +69,7 @@ class StepViewSet(OptimizationMixin, CreateUpdateModelAMixin, CreateModelMixin, return StepDetailSerializer return StepSerializer -class SubProductionViewSet(PageOrNot, CreateModelMixin, UpdateModelMixin, ListModelMixin, DestroyModelMixin, GenericViewSet): +class SubProductionViewSet(CreateUpdateModelAMixin, ModelViewSet): """ 产品生产分解增删改查 """ @@ -80,7 +80,7 @@ class SubProductionViewSet(PageOrNot, CreateModelMixin, UpdateModelMixin, ListMo serializer_class = SubProductionSerializer ordering = ['sort'] -class InputMaterialViewSet(CreateUpdateModelAMixin, ModelViewSet): +class InputMaterialViewSet(ModelViewSet): """ 输入物料-增删改查 """ @@ -97,7 +97,7 @@ class InputMaterialViewSet(CreateUpdateModelAMixin, ModelViewSet): return InputMaterialUpdateSerializer return InputMaterialSerializer -class OutputMaterialViewSet(CreateUpdateModelAMixin, ModelViewSet): +class OutputMaterialViewSet(ModelViewSet): """ 输出物料-增删改查 """ @@ -114,7 +114,7 @@ class OutputMaterialViewSet(CreateUpdateModelAMixin, ModelViewSet): return OutputMaterialUpdateSerializer return OutputMaterialSerializer -class UsedStepViewSet(OptimizationMixin, CreateUpdateModelAMixin, CreateModelMixin, DestroyModelMixin, ListModelMixin, GenericViewSet): +class UsedStepViewSet(OptimizationMixin, CreateModelMixin, DestroyModelMixin, ListModelMixin, GenericViewSet): """ 产品生产子工序表 """