From 08903f357ec70e1d2e4b56a40f9c5488dc8f3965 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 14 May 2020 15:02:46 +1000 Subject: [PATCH] Auto-increment the purchase-order number when creating a new one --- InvenTree/order/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 41a5b231a7..c8a78a8fa9 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -290,6 +290,7 @@ class PurchaseOrderCreate(AjaxCreateView): def get_initial(self): initials = super().get_initial().copy() + initials['reference'] = PurchaseOrder.getNextOrderNumber() initials['status'] = PurchaseOrderStatus.PENDING supplier_id = self.request.GET.get('supplier', None)