Auto-increment the purchase-order number when creating a new one

This commit is contained in:
Oliver Walters 2020-05-14 15:02:46 +10:00
parent cebfe9a30f
commit 08903f357e

View File

@ -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)