mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Refactor for SupplierPart detail page
This commit is contained in:
parent
05b01e4d6c
commit
f3e8edaf1f
@ -165,7 +165,8 @@ src="{% static 'img/blank_image.png' %}"
|
||||
</div>
|
||||
<div class='panel-content'>
|
||||
<div id='button-bar'>
|
||||
<div class='btn-group'>
|
||||
<div class='btn-group' role='group'>
|
||||
{% include "filter_list.html" with id='purchaseorder' %}
|
||||
</div>
|
||||
</div>
|
||||
<table class='table table-striped table-condensed po-table' id='purchase-order-table' data-toolbar='#button-bar'>
|
||||
@ -326,14 +327,19 @@ $("#item-create").click(function() {
|
||||
});
|
||||
|
||||
$('#order-part, #order-part2').click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'order-parts' %}",
|
||||
|
||||
inventreeGet(
|
||||
'{% url "api-part-detail" part.part.pk %}', {},
|
||||
{
|
||||
data: {
|
||||
part: {{ part.part.id }},
|
||||
},
|
||||
reload: true,
|
||||
},
|
||||
success: function(response) {
|
||||
orderParts([response], {
|
||||
supplier_part: {{ part.pk }},
|
||||
{% if part.supplier %}
|
||||
supplier: {{ part.supplier.pk }},
|
||||
{% endif %}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -681,6 +681,7 @@ function orderParts(parts_list, options={}) {
|
||||
required: true,
|
||||
type: 'related field',
|
||||
auto_fill: true,
|
||||
value: options.supplier_part,
|
||||
filters: supplier_part_filters,
|
||||
noResults: function(query) {
|
||||
return '{% trans "No matching supplier parts" %}';
|
||||
@ -695,6 +696,7 @@ function orderParts(parts_list, options={}) {
|
||||
required: true,
|
||||
type: 'related field',
|
||||
auto_fill: false,
|
||||
value: options.order,
|
||||
filters: order_filters,
|
||||
noResults: function(query) {
|
||||
return '{% trans "No matching purchase orders" %}';
|
||||
|
Loading…
Reference in New Issue
Block a user