mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Fix broken delete button (#3116)
* Fix broken delete button * Fix filtering for purchaseorder table on supplierpart page (cherry picked from commit 77fb02ff39c78f1b77eddd48d8f0acb4794fc966)
This commit is contained in:
parent
bc8777f93c
commit
2074bf9156
@ -309,7 +309,9 @@ $('#new-price-break').click(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
loadPurchaseOrderTable($("#purchase-order-table"), {
|
loadPurchaseOrderTable($("#purchase-order-table"), {
|
||||||
url: "{% url 'api-po-list' %}?supplier_part={{ part.id }}",
|
params: {
|
||||||
|
supplier_part: {{ part.id }},
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
loadStockTable($("#stock-table"), {
|
loadStockTable($("#stock-table"), {
|
||||||
@ -359,14 +361,23 @@ $('#edit-part').click(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#delete-part').click(function() {
|
$('#delete-part').click(function() {
|
||||||
|
inventreeGet(
|
||||||
deleteSupplierPart({{ part.pk }}, {
|
'{% url "api-supplier-part-detail" part.pk %}',
|
||||||
onSuccess: function() {
|
{},
|
||||||
{% if part.supplier %}
|
{
|
||||||
window.location.href = "{% url 'company-detail' part.supplier.id %}";
|
success: function(part) {
|
||||||
{% endif %}
|
deleteSupplierParts([part], {
|
||||||
|
success: function() {
|
||||||
|
{% if part.supplier %}
|
||||||
|
window.location.href = '{% url "company-detail" part.supplier.id %}';
|
||||||
|
{% else %}
|
||||||
|
window.location.href = '{% url "index" %}';
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
enableSidebar('supplierpart');
|
enableSidebar('supplierpart');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user