2
0
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:
Oliver
2022-07-20 12:53:31 +10:00
committed by GitHub
parent e383d6e955
commit afcd60b387
4 changed files with 80 additions and 20 deletions

View File

@ -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');
},
}
});
});