sale audit 变更审核和订单状态
This commit is contained in:
parent
b743675190
commit
7a97e5e99b
|
@ -131,6 +131,7 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C
|
||||||
fifo.is_audited = True
|
fifo.is_audited = True
|
||||||
fifo.auditor = request.user
|
fifo.auditor = request.user
|
||||||
fifo.inout_date = timezone.now()
|
fifo.inout_date = timezone.now()
|
||||||
|
fifo.create_by = request.user
|
||||||
fifo.save()
|
fifo.save()
|
||||||
# 出库条目
|
# 出库条目
|
||||||
spds = SaleProduct.objects.filter(sale=obj)
|
spds = SaleProduct.objects.filter(sale=obj)
|
||||||
|
@ -172,6 +173,11 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C
|
||||||
# 变更审核状态
|
# 变更审核状态
|
||||||
obj.is_audited = True
|
obj.is_audited = True
|
||||||
obj.save()
|
obj.save()
|
||||||
|
# 变更订单状态
|
||||||
|
if obj.order:
|
||||||
|
order = obj.order
|
||||||
|
order.delivered_count = order.delivered_count + obj.count
|
||||||
|
order.save()
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet):
|
class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet):
|
||||||
|
|
Loading…
Reference in New Issue