feat: 采购入库才可进行检验
This commit is contained in:
parent
923ac2276c
commit
24bdb818a5
|
@ -16,6 +16,11 @@ class MIOItemwCreateUpdateSerializer(CustomModelSerializer):
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
mioitem: MIOItem = attrs["mioitem"]
|
mioitem: MIOItem = attrs["mioitem"]
|
||||||
mio: MIO = mioitem.mio
|
mio: MIO = mioitem.mio
|
||||||
|
ftest_data = attrs.get("ftest", None)
|
||||||
|
if ftest_data and mio.type == MIO.MIO_TYPE_PUR_IN:
|
||||||
|
ftest_data["type"] = "purin"
|
||||||
|
else:
|
||||||
|
raise ParseError('采购入库才可进行检验')
|
||||||
if mioitem.mio.submit_time is not None:
|
if mioitem.mio.submit_time is not None:
|
||||||
raise ParseError('出入库已提交不可编辑')
|
raise ParseError('出入库已提交不可编辑')
|
||||||
wpr: Wpr = attrs.get("wpr", None)
|
wpr: Wpr = attrs.get("wpr", None)
|
||||||
|
|
Loading…
Reference in New Issue