2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

Refactor add_tracking_entry

This commit is contained in:
Oliver Walters
2021-05-11 20:56:20 +10:00
parent 385131137f
commit 0020e85397
2 changed files with 39 additions and 37 deletions

View File

@ -370,19 +370,17 @@ class PurchaseOrder(Order):
tracking_info = {
'status': status,
'purchaseorder': self.pk,
'quantity': quantity,
}
if location:
tracking_info['location'] = location.pk
stock.add_tracking_entry(
StockHistoryCode.RECEIVED_AGAINST_PURCHASE_ORDER,
user,
notes=notes,
url=self.get_absolute_url(),
deltas=tracking_info
deltas=tracking_info,
location=location,
purchaseorder=self,
quantity=quantity
)
# Update the number of parts received against the particular line item