From 306f916f0019d3da2b6e60e056a8fdb493c14490 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 16:26:59 +0800 Subject: [PATCH] salecreate validate product --- hb_server/apps/sam/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hb_server/apps/sam/serializers.py b/hb_server/apps/sam/serializers.py index eb3a840..e00b9cb 100644 --- a/hb_server/apps/sam/serializers.py +++ b/hb_server/apps/sam/serializers.py @@ -72,7 +72,7 @@ class SaleCreateSerializer(serializers.ModelSerializer): attrs['customer'] = order.customer attrs['product'] = order.product for i in attrs['iproducts']: - if i.material is not attrs['product']: + if i.material != attrs['product']: raise exceptions.APIException('产品选取错误') return super().validate(attrs)