wpm post bug

This commit is contained in:
caoqianming 2021-11-09 16:18:34 +08:00
parent 0f229df8f0
commit 537fda2e86
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ class OperationDetailSerializer(serializers.ModelSerializer):
fields = '__all__'
def get_wproducts_(self, obj):
return list(WProduct.objects.filter(id__in=obj.wproducts_).values('id', 'number'))
return list(WProduct.objects.filter(id__in=obj.wproducts).values('id', 'number'))
class OperationListSerializer(serializers.ModelSerializer):
create_by_ = UserSimpleSerializer(source='create_by', read_only=True)

View File

@ -145,7 +145,7 @@ class DoFormSubmit(CreateAPIView, GenericAPIView):
action_obj.p_state = vdata['step']
if 'wproducts' in data and data['wproducts']:
action_obj.wproducts = data['wproducts']
action_obj.m_state = vdata[0].m_state
action_obj.m_state = vdata['wproducts'][0].m_state
action_obj.remark = vdata.get('remark', '') # 操作备注
action_obj.create_by = request.user
action_obj.save()