报废操作bug
This commit is contained in:
parent
0827f5de77
commit
09de208ca5
|
@ -338,7 +338,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
||||||
报废操作
|
报废操作
|
||||||
"""
|
"""
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
if obj.ow_wproduct.ow_operation.count() >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
|
if Operation.objects.filter(ow_operation__ow_wproduct=obj, is_submited=True) >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
|
||||||
raise exceptions.APIException('该产品不支持直接报废')
|
raise exceptions.APIException('该产品不支持直接报废')
|
||||||
obj.act_state = WProduct.WPR_ACT_STATE_SCRAP
|
obj.act_state = WProduct.WPR_ACT_STATE_SCRAP
|
||||||
obj.update_by = request.user
|
obj.update_by = request.user
|
||||||
|
|
Loading…
Reference in New Issue