mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Business logic
This commit is contained in:
parent
ec669dd670
commit
228bf4e1da
@ -64,7 +64,9 @@ InvenTree | {{ order }}
|
|||||||
|
|
||||||
<h4>Order Items</h4>
|
<h4>Order Items</h4>
|
||||||
|
|
||||||
|
{% if order.status == OrderStatus.PENDING %}
|
||||||
<button type='button' class='btn btn-default' id='new-po-line'>Add Line Item</button>
|
<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'>
|
<table class='table table-striped table-condensed' id='po-lines-table'>
|
||||||
<tr>
|
<tr>
|
||||||
@ -118,6 +120,7 @@ $("#edit-order").click(function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{% if order.status == OrderStatus.PENDING %}
|
||||||
$('#new-po-line').click(function() {
|
$('#new-po-line').click(function() {
|
||||||
launchModalForm("{% url 'po-line-item-create' %}",
|
launchModalForm("{% url 'po-line-item-create' %}",
|
||||||
{
|
{
|
||||||
@ -139,6 +142,7 @@ $('#new-po-line').click(function() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
$("#po-lines-table").bootstrapTable({
|
$("#po-lines-table").bootstrapTable({
|
||||||
});
|
});
|
||||||
|
@ -87,7 +87,7 @@ class PurchaseOrderEdit(AjaxUpdateView):
|
|||||||
order = self.get_object()
|
order = self.get_object()
|
||||||
|
|
||||||
# Prevent user from editing supplier if there are already lines in the order
|
# 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()
|
form.fields['supplier'].widget = HiddenInput()
|
||||||
|
|
||||||
return form
|
return form
|
||||||
@ -121,7 +121,7 @@ class PurchaseOrderIssue(AjaxUpdateView):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if valid:
|
if valid:
|
||||||
order.issue_order()
|
order.place_order()
|
||||||
|
|
||||||
return self.renderJsonResponse(request, form, data)
|
return self.renderJsonResponse(request, form, data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user