From 3a266cf32296c32df82990da337e68bb4c9f5830 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 4 Aug 2020 11:10:24 +1000 Subject: [PATCH 01/12] Allow default_keywords to be null --- InvenTree/part/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 550645cb68..01768b4bb3 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -65,7 +65,7 @@ class PartCategory(InvenTreeTree): help_text=_('Default location for parts in this category') ) - default_keywords = models.CharField(blank=True, max_length=250, help_text=_('Default keywords for parts in this category')) + default_keywords = models.CharField(null=True, blank=True, max_length=250, help_text=_('Default keywords for parts in this category')) def get_absolute_url(self): return reverse('category-detail', kwargs={'pk': self.id}) From 0f199556df6bd498f01cccdce6316b733c876acc Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 4 Aug 2020 11:21:27 +1000 Subject: [PATCH 02/12] Add migration file --- .../part/migrations/0046_auto_20200804_0107.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 InvenTree/part/migrations/0046_auto_20200804_0107.py diff --git a/InvenTree/part/migrations/0046_auto_20200804_0107.py b/InvenTree/part/migrations/0046_auto_20200804_0107.py new file mode 100644 index 0000000000..5a0952c1e4 --- /dev/null +++ b/InvenTree/part/migrations/0046_auto_20200804_0107.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2020-08-04 01:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0045_auto_20200605_0932'), + ] + + operations = [ + migrations.AlterField( + model_name='partcategory', + name='default_keywords', + field=models.CharField(blank=True, help_text='Default keywords for parts in this category', max_length=250, null=True), + ), + ] From 7b332d93ee8bc5f1d7c9cfeb1c25a89cb4ccc58a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 8 Aug 2020 08:48:27 +1000 Subject: [PATCH 03/12] Rearrange button layouts --- .../stock/templates/stock/item_base.html | 21 ++++++++++++------- InvenTree/templates/js/stock.html | 8 +------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index a35b5f0346..8a57c8bdaf 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -86,30 +86,35 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% endif %} - {% if item.in_stock %} - {% endif %} From a2c3c1086cea8515bc6cd9976531b5a73aba99bb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 8 Aug 2020 09:31:57 +1000 Subject: [PATCH 10/12] Catch unhandled javascript errors --- InvenTree/stock/templates/stock/item_base.html | 2 +- InvenTree/templates/status_codes.html | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 9b0b182848..ce055d65c5 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -161,7 +161,7 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% trans "Customer" %} - {{ item.customer.name }} + {{ item.customer.name }} {% endif %} {% if item.belongs_to %} diff --git a/InvenTree/templates/status_codes.html b/InvenTree/templates/status_codes.html index 029252a842..f032f97309 100644 --- a/InvenTree/templates/status_codes.html +++ b/InvenTree/templates/status_codes.html @@ -18,14 +18,18 @@ function {{ label }}StatusDisplay(key) { key = String(key); - var value = {{ label }}Codes[key].value; + var value = null; + var label = null; + + if (key in {{ label }}Codes) { + value = {{ label }}Codes[key].value; + label = {{ label }}Codes[key].label; + } if (value == null || value.length == 0) { value = key; + label = ''; } - // Select the label color - var label = {{ label }}Codes[key].label ?? ''; - return `${value}`; } From 8d9cfd3678f722c2454a801a08c86da21d49acf6 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 8 Aug 2020 09:44:21 +1000 Subject: [PATCH 11/12] Migration file for StockStatus codes --- .../migrations/0048_auto_20200807_2344.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 InvenTree/stock/migrations/0048_auto_20200807_2344.py diff --git a/InvenTree/stock/migrations/0048_auto_20200807_2344.py b/InvenTree/stock/migrations/0048_auto_20200807_2344.py new file mode 100644 index 0000000000..b859344bb0 --- /dev/null +++ b/InvenTree/stock/migrations/0048_auto_20200807_2344.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.7 on 2020-08-07 23:44 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0047_auto_20200605_0932'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='status', + field=models.PositiveIntegerField(choices=[(10, 'OK'), (50, 'Attention needed'), (55, 'Damaged'), (60, 'Destroyed'), (70, 'Lost'), (65, 'Rejected'), (85, 'Returned')], default=10, validators=[django.core.validators.MinValueValidator(0)]), + ), + ] From eac53c836c89bc6bfaed57a89a3b2a7684b4582a Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 8 Aug 2020 09:52:14 +1000 Subject: [PATCH 12/12] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a66e3c10ff..1ada93e6b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/inventree/InvenTree.svg?branch=master)](https://travis-ci.org/inventree/InvenTree) [![Documentation Status](https://readthedocs.org/projects/inventree/badge/?version=latest)](https://inventree.readthedocs.io/en/latest/?badge=latest) [![Coverage Status](https://coveralls.io/repos/github/inventree/InvenTree/badge.svg)](https://coveralls.io/github/inventree/InvenTree) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/inventree/InvenTree.svg?branch=master)](https://travis-ci.org/inventree/InvenTree) [![Coverage Status](https://coveralls.io/repos/github/inventree/InvenTree/badge.svg)](https://coveralls.io/github/inventree/InvenTree) InvenTree @@ -15,7 +15,7 @@ Refer to the [getting started guide](https://inventree.github.io/docs/start/inst ## Documentation -For InvenTree documentation, refer to the [InvenTre documentation website](https://inventree.github.io). +For InvenTree documentation, refer to the [InvenTree documentation website](https://inventree.github.io). ## Integration