From 15817ce61a5a32d473dc67c02f3d3800564bce41 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 5 Jun 2020 19:26:41 +1000 Subject: [PATCH 1/2] Add "IPN" column to part table --- InvenTree/templates/js/part.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/InvenTree/templates/js/part.html b/InvenTree/templates/js/part.html index 1a40c7ad84..c9901cdb68 100644 --- a/InvenTree/templates/js/part.html +++ b/InvenTree/templates/js/part.html @@ -95,6 +95,8 @@ function loadPartTable(table, url, options={}) { field: 'pk', title: 'ID', visible: false, + switchable: false, + searchable: false, } ]; @@ -103,9 +105,16 @@ function loadPartTable(table, url, options={}) { checkbox: true, title: '{% trans 'Select' %}', searchable: false, + switchable: false, }); } + columns.push({ + field: 'IPN', + title: 'IPN', + sortable: true, + }), + columns.push({ field: 'name', title: '{% trans 'Part' %}', @@ -231,6 +240,7 @@ function loadPartTable(table, url, options={}) { original: params, formatNoMatches: function() { return "{% trans "No parts found" %}"; }, columns: columns, + showColumns: true, }); if (options.buttons) { From 16d261d956191fc563f7be8d55c2c1875d0726ce Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 5 Jun 2020 19:33:32 +1000 Subject: [PATCH 2/2] Make description fields optional --- InvenTree/InvenTree/models.py | 8 ++++--- .../migrations/0044_auto_20200605_0931.py | 24 +++++++++++++++++++ .../migrations/0045_auto_20200605_0932.py | 18 ++++++++++++++ .../migrations/0046_auto_20200605_0931.py | 24 +++++++++++++++++++ .../migrations/0047_auto_20200605_0932.py | 18 ++++++++++++++ 5 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 InvenTree/part/migrations/0044_auto_20200605_0931.py create mode 100644 InvenTree/part/migrations/0045_auto_20200605_0932.py create mode 100644 InvenTree/stock/migrations/0046_auto_20200605_0931.py create mode 100644 InvenTree/stock/migrations/0047_auto_20200605_0932.py diff --git a/InvenTree/InvenTree/models.py b/InvenTree/InvenTree/models.py index d0ed73f27a..cffe48cc0b 100644 --- a/InvenTree/InvenTree/models.py +++ b/InvenTree/InvenTree/models.py @@ -102,12 +102,14 @@ class InvenTreeTree(MPTTModel): name = models.CharField( blank=False, max_length=100, - validators=[validate_tree_name] + validators=[validate_tree_name], + help_text=_("Name"), ) description = models.CharField( - blank=False, - max_length=250 + blank=True, + max_length=250, + help_text=_("Description (optional)") ) # When a category is deleted, graft the children onto its parent diff --git a/InvenTree/part/migrations/0044_auto_20200605_0931.py b/InvenTree/part/migrations/0044_auto_20200605_0931.py new file mode 100644 index 0000000000..bdce0ebc02 --- /dev/null +++ b/InvenTree/part/migrations/0044_auto_20200605_0931.py @@ -0,0 +1,24 @@ +# Generated by Django 3.0.5 on 2020-06-05 09:31 + +import InvenTree.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0043_auto_20200527_0005'), + ] + + operations = [ + migrations.AlterField( + model_name='partcategory', + name='description', + field=models.CharField(blank=True, help_text='Description', max_length=250), + ), + migrations.AlterField( + model_name='partcategory', + name='name', + field=models.CharField(help_text='Name', max_length=100, validators=[InvenTree.validators.validate_tree_name]), + ), + ] diff --git a/InvenTree/part/migrations/0045_auto_20200605_0932.py b/InvenTree/part/migrations/0045_auto_20200605_0932.py new file mode 100644 index 0000000000..a9be054468 --- /dev/null +++ b/InvenTree/part/migrations/0045_auto_20200605_0932.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-06-05 09:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0044_auto_20200605_0931'), + ] + + operations = [ + migrations.AlterField( + model_name='partcategory', + name='description', + field=models.CharField(blank=True, help_text='Description (optional)', max_length=250), + ), + ] diff --git a/InvenTree/stock/migrations/0046_auto_20200605_0931.py b/InvenTree/stock/migrations/0046_auto_20200605_0931.py new file mode 100644 index 0000000000..8c37c31453 --- /dev/null +++ b/InvenTree/stock/migrations/0046_auto_20200605_0931.py @@ -0,0 +1,24 @@ +# Generated by Django 3.0.5 on 2020-06-05 09:31 + +import InvenTree.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0045_stockitem_customer'), + ] + + operations = [ + migrations.AlterField( + model_name='stocklocation', + name='description', + field=models.CharField(blank=True, help_text='Description', max_length=250), + ), + migrations.AlterField( + model_name='stocklocation', + name='name', + field=models.CharField(help_text='Name', max_length=100, validators=[InvenTree.validators.validate_tree_name]), + ), + ] diff --git a/InvenTree/stock/migrations/0047_auto_20200605_0932.py b/InvenTree/stock/migrations/0047_auto_20200605_0932.py new file mode 100644 index 0000000000..5ca509f13f --- /dev/null +++ b/InvenTree/stock/migrations/0047_auto_20200605_0932.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-06-05 09:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0046_auto_20200605_0931'), + ] + + operations = [ + migrations.AlterField( + model_name='stocklocation', + name='description', + field=models.CharField(blank=True, help_text='Description (optional)', max_length=250), + ), + ]