From 6e31a8111b296b15219b39aaf3f0ad349c0de37b Mon Sep 17 00:00:00 2001 From: eeintech Date: Mon, 4 Oct 2021 15:57:07 -0400 Subject: [PATCH 1/4] Fix plural name for Companies in Admin interface --- InvenTree/company/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/company/models.py b/InvenTree/company/models.py index b0bb8caaa5..ebe61a74b0 100644 --- a/InvenTree/company/models.py +++ b/InvenTree/company/models.py @@ -94,6 +94,7 @@ class Company(models.Model): constraints = [ UniqueConstraint(fields=['name', 'email'], name='unique_name_email_pair') ] + verbose_name_plural = "Companies" name = models.CharField(max_length=100, blank=False, help_text=_('Company name'), From a735a3e15cfc1111809d4bea4c9c1b167a90a5d7 Mon Sep 17 00:00:00 2001 From: eeintech Date: Mon, 4 Oct 2021 16:41:41 -0400 Subject: [PATCH 2/4] Added migration file --- .../migrations/0041_alter_company_options.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 InvenTree/company/migrations/0041_alter_company_options.py diff --git a/InvenTree/company/migrations/0041_alter_company_options.py b/InvenTree/company/migrations/0041_alter_company_options.py new file mode 100644 index 0000000000..40849eed1d --- /dev/null +++ b/InvenTree/company/migrations/0041_alter_company_options.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.5 on 2021-10-04 20:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('company', '0040_alter_company_currency'), + ] + + operations = [ + migrations.AlterModelOptions( + name='company', + options={'ordering': ['name'], 'verbose_name_plural': 'Companies'}, + ), + ] From 99503a60d3f97212dd3247c4ea637ea6758aa5f1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 5 Oct 2021 12:16:41 +1100 Subject: [PATCH 3/4] Fix for "barcode" field in purchase order receive serializer - Allow blank values! --- InvenTree/order/serializers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/order/serializers.py b/InvenTree/order/serializers.py index da2d23cd0d..f288f8a8e2 100644 --- a/InvenTree/order/serializers.py +++ b/InvenTree/order/serializers.py @@ -235,6 +235,7 @@ class POLineItemReceiveSerializer(serializers.Serializer): help_text=_('Unique identifier field'), default='', required=False, + allow_blank=True, ) def validate_barcode(self, barcode): From a3ba33cae884b06e1af0d60b88ea3f725734e96b Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 5 Oct 2021 12:32:54 +1100 Subject: [PATCH 4/4] Fixes for build output tables - Only show "completed" builds in the "completed builds" table (should be obvious) - Display "serial number" appropriately in build output allocation table --- InvenTree/build/templates/build/detail.html | 1 + InvenTree/stock/serializers.py | 1 + InvenTree/templates/js/translated/build.js | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index 421cac059c..cf3a4bece1 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -292,6 +292,7 @@ loadStockTable($("#build-stock-table"), { location_detail: true, part_detail: true, build: {{ build.id }}, + is_building: false, }, groupByField: 'location', buttons: [ diff --git a/InvenTree/stock/serializers.py b/InvenTree/stock/serializers.py index 535321ca80..70dd55a4eb 100644 --- a/InvenTree/stock/serializers.py +++ b/InvenTree/stock/serializers.py @@ -64,6 +64,7 @@ class StockItemSerializerBrief(InvenTreeModelSerializer): 'location', 'location_name', 'quantity', + 'serial', ] diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index d359d6cf4e..dbcdbecb5e 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -623,8 +623,15 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { var url = ''; - if (row.serial && row.quantity == 1) { - text = `{% trans "Serial Number" %}: ${row.serial}`; + + var serial = row.serial; + + if (row.stock_item_detail) { + serial = row.stock_item_detail.serial; + } + + if (serial && row.quantity == 1) { + text = `{% trans "Serial Number" %}: ${serial}`; } else { text = `{% trans "Quantity" %}: ${row.quantity}`; }