diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index 1f7b0b3..8269505 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -165,10 +165,10 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C ip['iproduct'] = i ips.append(FIFOItemProduct(**ip)) FIFOItemProduct.objects.bulk_create(ips) + # 更新成品库情况 + IProduct.objects.filter(sale_iproduct__sale=obj).update(is_saled=True) # 更新库存 update_inm(fifo) - # 更新成品库情况 - ips.update(is_saled=True) return Response() class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet):