From bb270d7105b50f5066a56c24a5fc715d55847e6f Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sun, 8 Sep 2024 14:32:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20inm=20mio=E7=9B=B8=E5=85=B3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0inout=5Fdate=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/inm/serializers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/inm/serializers.py b/apps/inm/serializers.py index 4e0ba42a..866c337b 100644 --- a/apps/inm/serializers.py +++ b/apps/inm/serializers.py @@ -168,6 +168,7 @@ class MIODoSerializer(CustomModelSerializer): model = MIO fields = ['id', 'number', 'note', 'do_user', 'belong_dept', 'type', 'inout_date', 'mgroup'] + extra_kwargs = {'inout_date': {'required': True}, 'do_user': {'required': True}} def validate(self, attrs): if 'mgroup' in attrs and attrs['mgroup']: @@ -193,6 +194,7 @@ class MIOSaleSerializer(CustomModelSerializer): class Meta: model = MIO fields = ['id', 'number', 'note', 'order', 'inout_date', 'customer'] + extra_kwargs = {'inout_date': {'required': True}} def create(self, validated_data): validated_data['type'] = MIO.MIO_TYPE_SALE_OUT @@ -219,6 +221,7 @@ class MIOPurSerializer(CustomModelSerializer): class Meta: model = MIO fields = ['id', 'number', 'note', 'pu_order', 'inout_date', 'supplier'] + extra_kwargs = {'inout_date': {'required': True}} def create(self, validated_data): validated_data['type'] = MIO.MIO_TYPE_PUR_IN @@ -244,6 +247,7 @@ class MIOOtherSerializer(CustomModelSerializer): model = MIO fields = ['id', 'number', 'note', 'supplier', 'customer', 'type', 'inout_date'] + extra_kwargs = {'inout_date': {'required': True}} def create(self, validated_data): if validated_data['type'] not in [MIO.MIO_TYPE_OTHER_OUT, MIO.MIO_TYPE_OTHER_IN]: