mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 20:45:44 +00:00
"Fixes" for completing a build
- This will require a lot of unit testing to get right
This commit is contained in:
@ -25,7 +25,7 @@ from company.models import Company, SupplierPart
|
||||
|
||||
from InvenTree.fields import RoundingDecimalField
|
||||
from InvenTree.helpers import decimal2string, normalize
|
||||
from InvenTree.status_codes import PurchaseOrderStatus, SalesOrderStatus
|
||||
from InvenTree.status_codes import PurchaseOrderStatus, SalesOrderStatus, StockStatus
|
||||
from InvenTree.models import InvenTreeAttachment
|
||||
|
||||
|
||||
@ -574,12 +574,15 @@ class SalesOrderAllocation(models.Model):
|
||||
# Grab a copy of the new stock item (which will keep track of its "parent")
|
||||
item = item.splitStock(self.quantity, None, user)
|
||||
|
||||
# Update our own reference to the new item
|
||||
self.item = item
|
||||
self.save()
|
||||
|
||||
# Assign the StockItem to the SalesOrder customer
|
||||
item.customer = self.line.order.customer
|
||||
|
||||
# Clear the location
|
||||
item.location = None
|
||||
item.status = StockStatus.SENT_TO_CUSTOMER
|
||||
|
||||
item.save()
|
||||
|
||||
print("Finalizing allocation for: " + str(self.item))
|
||||
|
Reference in New Issue
Block a user