From c99aae5a28680a62b4eb5670427333f058aedaad Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 10 Jan 2025 18:10:42 +1100 Subject: [PATCH] Updated docstring (#8868) --- src/backend/InvenTree/order/models.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/backend/InvenTree/order/models.py b/src/backend/InvenTree/order/models.py index 2c24f63e8a..634a9a1363 100644 --- a/src/backend/InvenTree/order/models.py +++ b/src/backend/InvenTree/order/models.py @@ -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', '')