2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

feat(purchase orders): show the preferred location for each PO Line

Adds the ability for the Purchaser to specify where the item is
intentended to go when received.  If the Purchaser does not set a
preferred location, then the default location for the part is displayed.
If the item is received them where it was actually placed is shown.

NOTE: if an item is split when received only one of the resulting
StockItem location is used.

Fixes #1467
Addresses some of the requests in #551
This commit is contained in:
Nigel
2021-05-14 13:17:31 -06:00
parent 0076c0cec5
commit cd07ea835d
6 changed files with 73 additions and 2 deletions

View File

@ -17,6 +17,7 @@ from InvenTree.serializers import InvenTreeAttachmentSerializerField
from company.serializers import CompanyBriefSerializer, SupplierPartSerializer
from part.serializers import PartBriefSerializer
from stock.serializers import LocationBriefSerializer
from .models import PurchaseOrder, PurchaseOrderLineItem
from .models import PurchaseOrderAttachment, SalesOrderAttachment
@ -116,6 +117,8 @@ class POLineItemSerializer(InvenTreeModelSerializer):
purchase_price_string = serializers.CharField(source='purchase_price', read_only=True)
destination = LocationBriefSerializer(source='get_destination', read_only=True)
class Meta:
model = PurchaseOrderLineItem
@ -132,6 +135,7 @@ class POLineItemSerializer(InvenTreeModelSerializer):
'purchase_price',
'purchase_price_currency',
'purchase_price_string',
'destination',
]