报废操作bug
This commit is contained in:
parent
09de208ca5
commit
2f30f51219
|
|
@ -338,7 +338,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
||||||
报废操作
|
报废操作
|
||||||
"""
|
"""
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
if Operation.objects.filter(ow_operation__ow_wproduct=obj, is_submited=True) >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
|
if Operation.objects.filter(ow_operation__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