Some PEP fixes

This commit is contained in:
Oliver 2021-12-02 23:58:02 +11:00
parent e1668c8662
commit ecf70b6d4d
4 changed files with 10 additions and 9 deletions

View File

@ -1014,7 +1014,6 @@ class SalesOrderShipment(models.Model):
# Iterate through each stock item assigned to this shipment
for allocation in allocations:
# Mark the allocation as "complete"
allocation.complete_allocation(user)

View File

@ -11,6 +11,7 @@ from django.core.exceptions import ValidationError as DjangoValidationError
from django.db import models, transaction
from django.db.models import Case, When, Value
from django.db.models import BooleanField, ExpressionWrapper, F
from InvenTree.InvenTree.status_codes import SalesOrderStatus
from rest_framework import serializers
from rest_framework.serializers import ValidationError
@ -748,7 +749,9 @@ class SalesOrderCompleteSerializer(serializers.Serializer):
order = self.context['order']
data = self.validated_data
# Mark this order as complete!
order.status = SalesOrderStatus.SHIPPED
order.save()
class SOShipmentAllocationSerializer(serializers.Serializer):
@ -816,7 +819,6 @@ class SOShipmentAllocationSerializer(serializers.Serializer):
with transaction.atomic():
for entry in items:
# Create a new SalesOrderAllocation
order.models.SalesOrderAllocation.objects.create(
line=entry.get('line_item'),

View File

@ -10,7 +10,7 @@ from company.models import Company
from InvenTree import status_codes as status
from order.models import SalesOrder, SalesOrderLineItem, SalesOrderShipment, SalesOrderAllocation
from order.models import SalesOrder, SalesOrderLineItem, SalesOrderAllocation
from part.models import Part