mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 13:35:40 +00:00
Create SupplierPart directly from PurchaseOrderLineItem dialog (#3361)
* Move JS code from html to external .js file * Add secondary dialog for creating a new SupplierPart from the PurchaseOrderLineItem dialog * JS linting
This commit is contained in:
@ -168,23 +168,16 @@
|
||||
{% if order.status == PurchaseOrderStatus.PENDING %}
|
||||
$('#new-po-line').click(function() {
|
||||
|
||||
var fields = poLineItemFields({
|
||||
order: {{ order.pk }},
|
||||
createPurchaseOrderLineItem({{ order.pk }}, {
|
||||
{% if order.supplier %}
|
||||
supplier: {{ order.supplier.pk }},
|
||||
{% if order.supplier.currency %}
|
||||
currency: '{{ order.supplier.currency }}',
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
});
|
||||
|
||||
constructForm('{% url "api-po-line-list" %}', {
|
||||
fields: fields,
|
||||
method: 'POST',
|
||||
title: '{% trans "Add Line Item" %}',
|
||||
onSuccess: function() {
|
||||
$('#po-line-table').bootstrapTable('refresh');
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user