mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Some PEP fixes
This commit is contained in:
		| @@ -1014,7 +1014,6 @@ class SalesOrderShipment(models.Model): | |||||||
|  |  | ||||||
|         # Iterate through each stock item assigned to this shipment |         # Iterate through each stock item assigned to this shipment | ||||||
|         for allocation in allocations: |         for allocation in allocations: | ||||||
|              |  | ||||||
|             # Mark the allocation as "complete" |             # Mark the allocation as "complete" | ||||||
|             allocation.complete_allocation(user) |             allocation.complete_allocation(user) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,6 +11,7 @@ from django.core.exceptions import ValidationError as DjangoValidationError | |||||||
| from django.db import models, transaction | from django.db import models, transaction | ||||||
| from django.db.models import Case, When, Value | from django.db.models import Case, When, Value | ||||||
| from django.db.models import BooleanField, ExpressionWrapper, F | from django.db.models import BooleanField, ExpressionWrapper, F | ||||||
|  | from InvenTree.InvenTree.status_codes import SalesOrderStatus | ||||||
|  |  | ||||||
| from rest_framework import serializers | from rest_framework import serializers | ||||||
| from rest_framework.serializers import ValidationError | from rest_framework.serializers import ValidationError | ||||||
| @@ -748,7 +749,9 @@ class SalesOrderCompleteSerializer(serializers.Serializer): | |||||||
|         order = self.context['order'] |         order = self.context['order'] | ||||||
|         data = self.validated_data |         data = self.validated_data | ||||||
|  |  | ||||||
|          |         # Mark this order as complete! | ||||||
|  |         order.status = SalesOrderStatus.SHIPPED | ||||||
|  |         order.save() | ||||||
|  |  | ||||||
|  |  | ||||||
| class SOShipmentAllocationSerializer(serializers.Serializer): | class SOShipmentAllocationSerializer(serializers.Serializer): | ||||||
| @@ -816,7 +819,6 @@ class SOShipmentAllocationSerializer(serializers.Serializer): | |||||||
|  |  | ||||||
|         with transaction.atomic(): |         with transaction.atomic(): | ||||||
|             for entry in items: |             for entry in items: | ||||||
|                  |  | ||||||
|                 # Create a new SalesOrderAllocation |                 # Create a new SalesOrderAllocation | ||||||
|                 order.models.SalesOrderAllocation.objects.create( |                 order.models.SalesOrderAllocation.objects.create( | ||||||
|                     line=entry.get('line_item'), |                     line=entry.get('line_item'), | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ from company.models import Company | |||||||
|  |  | ||||||
| from InvenTree import status_codes as status | 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 | from part.models import Part | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user