From 771a008e84458313cdf83ed3ae3aa609b6c6b622 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 13 Jun 2019 21:21:22 +1000 Subject: [PATCH] Printable string for PurchaseOrderLineItem --- InvenTree/order/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index aae5e5bfe9..27f57faa87 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -177,6 +177,13 @@ class PurchaseOrderLineItem(OrderLineItem): ('order', 'part') ) + def __str__(self): + return "{n} x {part} from {supplier} (for {po})".format( + n=self.quantity, + part=self.part.SKU if self.part else 'unknown part', + supplier=self.order.supplier.name, + po=self.order) + order = models.ForeignKey( PurchaseOrder, on_delete=models.CASCADE, related_name='lines',