2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Updated docstring (#8868)

This commit is contained in:
Oliver 2025-01-10 18:10:42 +11:00 committed by GitHub
parent dcff7a5ccd
commit c99aae5a28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -796,7 +796,26 @@ class PurchaseOrder(TotalPriceMixin, Order):
def receive_line_item(
self, line, location, quantity, user, status=StockStatus.OK.value, **kwargs
):
"""Receive a line item (or partial line item) against this PurchaseOrder."""
"""Receive a line item (or partial line item) against this PurchaseOrder.
Arguments:
line: The PurchaseOrderLineItem to receive against
location: The StockLocation to receive the item into
quantity: The quantity to receive
user: The User performing the action
status: The StockStatus to assign to the item (default: StockStatus.OK)
Keyword Arguments:
barch_code: Optional batch code for the new StockItem
serials: Optional list of serial numbers to assign to the new StockItem(s)
notes: Optional notes field for the StockItem
packaging: Optional packaging field for the StockItem
barcode: Optional barcode field for the StockItem
Raises:
ValidationError: If the quantity is negative or otherwise invalid
ValidationError: If the order is not in the 'PLACED' state
"""
# Extract optional batch code for the new stock item
batch_code = kwargs.get('batch_code', '')