diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index adb5a41ee6..592bef396a 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -1037,6 +1037,11 @@ a.anchor { height: 30px; } +/* Force minimum width of number input fields to show at least ~5 digits */ +input[type='number']{ + min-width: 80px; +} + .search-menu { padding-top: 2rem; } diff --git a/InvenTree/order/migrations/0049_alter_purchaseorderlineitem_unique_together.py b/InvenTree/order/migrations/0049_alter_purchaseorderlineitem_unique_together.py new file mode 100644 index 0000000000..c451e1754d --- /dev/null +++ b/InvenTree/order/migrations/0049_alter_purchaseorderlineitem_unique_together.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.4 on 2021-08-12 17:49 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('company', '0040_alter_company_currency'), + ('order', '0048_auto_20210702_2321'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='purchaseorderlineitem', + unique_together={('order', 'part', 'quantity', 'purchase_price')}, + ), + ] diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index 248ecb277d..e55f5203ba 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -729,7 +729,7 @@ class PurchaseOrderLineItem(OrderLineItem): class Meta: unique_together = ( - ('order', 'part') + ('order', 'part', 'quantity', 'purchase_price') ) def __str__(self): diff --git a/InvenTree/order/templates/order/order_wizard/match_parts.html b/InvenTree/order/templates/order/order_wizard/match_parts.html index e0f030bad5..4f84d205ee 100644 --- a/InvenTree/order/templates/order/order_wizard/match_parts.html +++ b/InvenTree/order/templates/order/order_wizard/match_parts.html @@ -115,7 +115,7 @@ {{ block.super }} $('.bomselect').select2({ - dropdownAutoWidth: true, + width: '100%', matcher: partialMatcher, }); diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index b05bfa7cc2..ed352d1135 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -327,7 +327,7 @@ $("#po-table").inventreeTable({ { sortable: true, sortName: 'part__MPN', - field: 'supplier_part_detail.MPN', + field: 'supplier_part_detail.manufacturer_part_detail.MPN', title: '{% trans "MPN" %}', formatter: function(value, row, index, field) { if (row.supplier_part_detail && row.supplier_part_detail.manufacturer_part) {