修改表名
This commit is contained in:
parent
b966714f7b
commit
950418a154
|
@ -54,7 +54,7 @@ class TestRecord(CommonAModel):
|
|||
fifo_detail = models.ForeignKey('inm.fifodetail', verbose_name='关联的出入库批次', on_delete=models.CASCADE, null=True, blank=True)
|
||||
|
||||
|
||||
class TestRecordDetail(BaseModel):
|
||||
class TestRecordItem(BaseModel):
|
||||
"""
|
||||
记录表格字段值
|
||||
"""
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.6 on 2021-11-08 01:35
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mtm', '0028_auto_20211102_1707'),
|
||||
('wpm', '0005_auto_20211108_0901'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='WProductRecordDetail',
|
||||
new_name='WProductRecordItem',
|
||||
),
|
||||
]
|
|
@ -70,7 +70,7 @@ class WProductRecord(CommonAModel):
|
|||
wproduct_action = models.ForeignKey(WProductAction, verbose_name='关联的生产操作', on_delete=models.CASCADE)
|
||||
|
||||
|
||||
class WProductRecordDetail(BaseModel):
|
||||
class WProductRecordItem(BaseModel):
|
||||
"""
|
||||
记录表格字段值
|
||||
"""
|
||||
|
|
|
@ -8,7 +8,7 @@ from apps.mtm.serializers import MaterialSimpleSerializer
|
|||
from apps.pm.models import SubProductionPlan, SubProductionProgress
|
||||
from django.utils import timezone
|
||||
|
||||
from apps.wpm.models import WMaterial, WProduct, WProductRecord, WProductRecordDetail
|
||||
from apps.wpm.models import WMaterial, WProduct, WProductRecord, WProductRecordItem
|
||||
|
||||
class PickDetailSerializer(serializers.Serializer):
|
||||
material = serializers.PrimaryKeyRelatedField(queryset=Material.objects.all(), label="物料ID")
|
||||
|
@ -95,13 +95,13 @@ class DoOutputSerializer(serializers.Serializer):
|
|||
material = serializers.PrimaryKeyRelatedField(queryset=Material.objects.all(), label='物料ID')
|
||||
count_output = serializers.IntegerField(min_value=0, label='产出数量')
|
||||
|
||||
class WProductRecordDetailSerializer(serializers.ModelSerializer):
|
||||
class WProductRecordItemSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = WProductRecordDetail
|
||||
model = WProductRecordItem
|
||||
fields = ['form_field', 'field_value']
|
||||
|
||||
class WProductRecordSerializer(serializers.ModelSerializer):
|
||||
record_data = WProductRecordDetailSerializer(many=True)
|
||||
record_data = WProductRecordItemSerializer(many=True)
|
||||
class Meta:
|
||||
model = WProductRecord
|
||||
fields = ['form', 'record_data']
|
||||
|
|
|
@ -12,7 +12,7 @@ from apps.pm.serializers import SubProductionPlanListSerializer, SubProductionPl
|
|||
|
||||
from apps.system.mixins import CreateUpdateModelAMixin, OptimizationMixin
|
||||
from rest_framework.decorators import action
|
||||
from apps.wpm.models import WMaterial, WProduct, WProductAction, WProductMaterial, WProductRecord, WProductRecordDetail
|
||||
from apps.wpm.models import WMaterial, WProduct, WProductAction, WProductMaterial, WProductRecord, WProductRecordItem
|
||||
|
||||
from apps.wpm.serializers import PickSerializer, WActionInitSerializer, WActionSubmitSerializer, WMaterialListSerializer
|
||||
from rest_framework.response import Response
|
||||
|
@ -181,8 +181,8 @@ class DoFormSubmit(CreateAPIView, GenericAPIView):
|
|||
m['field_value'] = form_field.field_value
|
||||
m['sort'] = form_field.sort
|
||||
m['wproduct_record'] = wr
|
||||
wrds.append(WProductRecordDetail(**m))
|
||||
WProductRecordDetail.objects.bulk_create(wrds)
|
||||
wrds.append(WProductRecordItem(**m))
|
||||
WProductRecordItem.objects.bulk_create(wrds)
|
||||
return Response()
|
||||
|
||||
|
Loading…
Reference in New Issue