From b7ae95686e40ce36898a7a4cc31cdfa027657155 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 23 Aug 2020 20:51:41 +1000 Subject: [PATCH] Add field "enabled" to Report template --- InvenTree/report/admin.py | 2 +- .../migrations/0003_testreport_enabled.py | 18 ++++++++++++++++++ InvenTree/report/models.py | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 InvenTree/report/migrations/0003_testreport_enabled.py diff --git a/InvenTree/report/admin.py b/InvenTree/report/admin.py index 9ec3c5c8f8..8efac4ac14 100644 --- a/InvenTree/report/admin.py +++ b/InvenTree/report/admin.py @@ -8,7 +8,7 @@ from .models import TestReport, ReportAsset class ReportTemplateAdmin(admin.ModelAdmin): - list_display = ('name', 'description', 'template') + list_display = ('name', 'description', 'template', 'enabled') class ReportAssetAdmin(admin.ModelAdmin): diff --git a/InvenTree/report/migrations/0003_testreport_enabled.py b/InvenTree/report/migrations/0003_testreport_enabled.py new file mode 100644 index 0000000000..74de252435 --- /dev/null +++ b/InvenTree/report/migrations/0003_testreport_enabled.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2020-08-23 10:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('report', '0002_delete_reporttemplate'), + ] + + operations = [ + migrations.AddField( + model_name='testreport', + name='enabled', + field=models.BooleanField(default=True, help_text='Report template is enabled', verbose_name='Enabled'), + ), + ] diff --git a/InvenTree/report/models.py b/InvenTree/report/models.py index 649c2d27cc..47d3b053ac 100644 --- a/InvenTree/report/models.py +++ b/InvenTree/report/models.py @@ -147,6 +147,12 @@ class ReportTemplateBase(models.Model): description = models.CharField(max_length=250, help_text=_("Report template description")) + enabled = models.BooleanField( + default=True, + help_text=_('Report template is enabled'), + verbose_name=_('Enabled') + ) + class Meta: abstract = True