diff --git a/InvenTree/InvenTree/static/script/inventree/modals.js b/InvenTree/InvenTree/static/script/inventree/modals.js index 80ada1596f..49de96468f 100644 --- a/InvenTree/InvenTree/static/script/inventree/modals.js +++ b/InvenTree/InvenTree/static/script/inventree/modals.js @@ -354,7 +354,7 @@ function renderErrorMessage(xhr) { var html = '' + xhr.statusText + '
'; - html += 'Status Code - ' + xhr.status + '

'; + html += 'Error Code - ' + xhr.status + '

'; html += `
@@ -811,16 +811,37 @@ function launchModalForm(url, options = {}) { $(modal).modal('hide'); // Permission denied! - if (xhr.status == 403) { + if (xhr.status == 400) { showAlertDialog( - "Permission Denied", + "Error 400: Bad Request", + "Server returned error code 400" + ); + } else if (xhr.status == 401) { + showAlertDialog( + "Error 401: Not Authenticated", + "Authentication credentials not supplied" + ); + } else if (xhr.status == 403) { + showAlertDialog( + "Error 403: Permission Denied", "You do not have the required permissions to access this function" ); - - return; + } else if (xhr.status == 404) { + showAlertDialog( + "Error 404: Resource Not Found", + "The requested resource could not be located on the server" + ); + } else if (xhr.status == 408) { + showAlertDialog( + "Error 408: Timeout", + "Connection timeout while requesting data from server" + ); + } else { + showAlertDialog('Error requesting form data', renderErrorMessage(xhr)); } - showAlertDialog('Error requesting form data', renderErrorMessage(xhr)); + console.log("Modal form error: " + xhr.status); + console.log("Message: " + xhr.responseText); } }; diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index 2a8d907b76..f1e249fd58 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -423,12 +423,16 @@ class SupplierPart(models.Model): return str(self) def __str__(self): - s = "{supplier} ({sku})".format( - sku=self.SKU, - supplier=self.supplier.name) + s = '' + + if self.part.IPN: + s += f'{self.part.IPN}' + s += ' | ' + + s += f'{self.supplier.name} | {self.SKU}' if self.manufacturer_string: - s = s + ' - ' + self.manufacturer_string + s = s + ' | ' + self.manufacturer_string return s diff --git a/InvenTree/company/templates/company/supplier_part_base.html b/InvenTree/company/templates/company/supplier_part_base.html index 383b942346..ca09caee93 100644 --- a/InvenTree/company/templates/company/supplier_part_base.html +++ b/InvenTree/company/templates/company/supplier_part_base.html @@ -94,7 +94,7 @@ src="{% static 'img/blank_image.png' %}" {% block js_ready %} {{ block.super }} -$('#order-part').click(function() { +$('#order-part, #order-part2').click(function() { launchModalForm( "{% url 'order-parts' %}", { diff --git a/InvenTree/company/templates/company/supplier_part_orders.html b/InvenTree/company/templates/company/supplier_part_orders.html index 381a2941e9..5c2ea6d1d4 100644 --- a/InvenTree/company/templates/company/supplier_part_orders.html +++ b/InvenTree/company/templates/company/supplier_part_orders.html @@ -6,18 +6,18 @@ {% include "company/supplier_part_tabs.html" with tab='orders' %} -
-

{% trans "Supplier Part Orders" %}

+
+
-
- -
+
+
+
- -
+ +
{% endblock %} diff --git a/InvenTree/company/templates/company/supplier_part_pricing.html b/InvenTree/company/templates/company/supplier_part_pricing.html index 28cc917e1a..f9f5063190 100644 --- a/InvenTree/company/templates/company/supplier_part_pricing.html +++ b/InvenTree/company/templates/company/supplier_part_pricing.html @@ -7,10 +7,10 @@ {% include "company/supplier_part_tabs.html" with tab='pricing' %} -
-

{% trans "Pricing Information" %}

+
+
diff --git a/InvenTree/company/templates/company/supplier_part_stock.html b/InvenTree/company/templates/company/supplier_part_stock.html index 95c2559977..a9b378e27b 100644 --- a/InvenTree/company/templates/company/supplier_part_stock.html +++ b/InvenTree/company/templates/company/supplier_part_stock.html @@ -6,10 +6,10 @@ {% include "company/supplier_part_tabs.html" with tab='stock' %} -
-

{% trans "Supplier Part Stock" %}

+
+ {% include "stock_table.html" %} {% endblock %} diff --git a/InvenTree/order/templates/order/po_received_items.html b/InvenTree/order/templates/order/po_received_items.html new file mode 100644 index 0000000000..b3b46c4aa4 --- /dev/null +++ b/InvenTree/order/templates/order/po_received_items.html @@ -0,0 +1,34 @@ +{% extends "order/order_base.html" %} + +{% load inventree_extras %} +{% load i18n %} +{% load static %} + +{% block details %} + +{% include 'order/po_tabs.html' with tab='received' %} + +

{% trans "Received Items" %}

+
+ +{% include "stock_table.html" with read_only=True %} + +{% endblock %} + +{% block js_ready %} +{{ block.super }} + +loadStockTable($("#stock-table"), { + params: { + purchase_order: {{ order.id }}, + part_detail: true, + supplier_detail: true, + location_detail: true, + }, + buttons: [ + '#stock-options', + ], + filterkey: "postock" +}); + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/templates/order/po_tabs.html b/InvenTree/order/templates/order/po_tabs.html index d5c7286c3f..5792107b04 100644 --- a/InvenTree/order/templates/order/po_tabs.html +++ b/InvenTree/order/templates/order/po_tabs.html @@ -2,7 +2,10 @@