mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Business logic
This commit is contained in:
parent
ec669dd670
commit
228bf4e1da
@ -64,7 +64,9 @@ InvenTree | {{ order }}
|
||||
|
||||
<h4>Order Items</h4>
|
||||
|
||||
{% if order.status == OrderStatus.PENDING %}
|
||||
<button type='button' class='btn btn-default' id='new-po-line'>Add Line Item</button>
|
||||
{% endif %}
|
||||
|
||||
<table class='table table-striped table-condensed' id='po-lines-table'>
|
||||
<tr>
|
||||
@ -118,6 +120,7 @@ $("#edit-order").click(function() {
|
||||
);
|
||||
});
|
||||
|
||||
{% if order.status == OrderStatus.PENDING %}
|
||||
$('#new-po-line').click(function() {
|
||||
launchModalForm("{% url 'po-line-item-create' %}",
|
||||
{
|
||||
@ -139,6 +142,7 @@ $('#new-po-line').click(function() {
|
||||
}
|
||||
);
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
$("#po-lines-table").bootstrapTable({
|
||||
});
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user