diff --git a/InvenTree/company/templates/company/manufacturer_part.html b/InvenTree/company/templates/company/manufacturer_part.html
index fb33128a77..a3a2bbc65e 100644
--- a/InvenTree/company/templates/company/manufacturer_part.html
+++ b/InvenTree/company/templates/company/manufacturer_part.html
@@ -31,13 +31,11 @@
{% include "admin_button.html" with url=url %}
{% endif %}
{% if roles.purchase_order.change %}
-{% comment "for later" %}
-{% if roles.purchase_order.add %}
+{% if roles.purchase_order.add and part.part.purchaseable %}
{% endif %}
-{% endcomment %}
@@ -130,6 +128,7 @@ src="{% static 'img/blank_image.png' %}"
{% trans "Delete" %}
+ {% include "filter_list.html" with id='supplier-part' %}
@@ -300,14 +299,20 @@ linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options']);
linkButtonsToSelection($("#parameter-table"), ['#parameter-options']);
$('#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], {
+ manufacturer_part: {{ part.pk }},
+ {% if part.manufacturer %}
+ manufacturer: {{ part.manufacturer.pk }},
+ {% endif %}
+ });
+ }
+ }
);
});
diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js
index 1b197a2766..214a6fa885 100644
--- a/InvenTree/templates/js/translated/order.js
+++ b/InvenTree/templates/js/translated/order.js
@@ -639,6 +639,14 @@ function orderParts(parts_list, options={}) {
supplier_part_filters.supplier = options.supplier;
}
+ if (options.manufacturer) {
+ supplier_part_filters.manufacturer = options.manufacturer;
+ }
+
+ if (options.manufacturer_part) {
+ supplier_part_filters.manufacturer_part = options.manufacturer_part;
+ }
+
// Construct API filtres for the PurchaseOrder field
var order_filters = {
status: {{ PurchaseOrderStatus.PENDING }},