2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

Business logic

This commit is contained in:
Oliver Walters
2019-06-10 22:17:19 +10:00
parent ec669dd670
commit 228bf4e1da
2 changed files with 6 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class PurchaseOrderEdit(AjaxUpdateView):
order = self.get_object()
# Prevent user from editing supplier if there are already lines in the order
if order.lines.count() > 0:
if order.lines.count() > 0 or not order.status == OrderStatus.PENDING:
form.fields['supplier'].widget = HiddenInput()
return form
@ -121,7 +121,7 @@ class PurchaseOrderIssue(AjaxUpdateView):
}
if valid:
order.issue_order()
order.place_order()
return self.renderJsonResponse(request, form, data)