fix: wmaterial get在传入query参数时完善can_do的逻辑
This commit is contained in:
parent
bb56becb5d
commit
dbad152218
|
@ -202,7 +202,8 @@ class WMaterialSerializer(CustomModelSerializer):
|
|||
|
||||
def to_representation(self, instance):
|
||||
ret = super().to_representation(instance)
|
||||
ret['count_cando'] = str(Decimal(ret['count']) - Decimal(ret['count_working']))
|
||||
if 'count' in ret:
|
||||
ret['count_cando'] = str(Decimal(ret['count']) - Decimal(ret['count_working']))
|
||||
return ret
|
||||
|
||||
class MlogbDefectSerializer(CustomModelSerializer):
|
||||
|
|
Loading…
Reference in New Issue