diff --git a/mayan/apps/document_states/apps.py b/mayan/apps/document_states/apps.py index f2c8ce61d1..53743a6d31 100644 --- a/mayan/apps/document_states/apps.py +++ b/mayan/apps/document_states/apps.py @@ -92,6 +92,10 @@ class DocumentStatesApp(apps.AppConfig): 'name': _('Is initial state?'), 'attribute': 'initial' }, + { + 'name': _('Completion'), + 'attribute': 'completion' + }, ]) register_model_list_columns(WorkflowTransition, [ diff --git a/mayan/apps/document_states/forms.py b/mayan/apps/document_states/forms.py index f13860c15b..3be2a5e2da 100644 --- a/mayan/apps/document_states/forms.py +++ b/mayan/apps/document_states/forms.py @@ -16,7 +16,7 @@ class WorkflowForm(forms.ModelForm): class WorkflowStateForm(forms.ModelForm): class Meta: - fields = ('initial', 'label') + fields = ('initial', 'label', 'completion') model = WorkflowState diff --git a/mayan/apps/document_states/migrations/0002_workflowstate_completion.py b/mayan/apps/document_states/migrations/0002_workflowstate_completion.py new file mode 100644 index 0000000000..2adc81c633 --- /dev/null +++ b/mayan/apps/document_states/migrations/0002_workflowstate_completion.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('document_states', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='workflowstate', + name='completion', + field=models.IntegerField(default=0, help_text='Enter the percent of completion that this state represents in relation to the workflow. Use numbers without the percent sign.', verbose_name='Completion', blank=True), + preserve_default=True, + ), + ] diff --git a/mayan/apps/document_states/models.py b/mayan/apps/document_states/models.py index 2998639fc5..01b97669e3 100644 --- a/mayan/apps/document_states/models.py +++ b/mayan/apps/document_states/models.py @@ -43,6 +43,7 @@ class WorkflowState(models.Model): workflow = models.ForeignKey(Workflow, related_name='states', verbose_name=_('Workflow')) label = models.CharField(max_length=255, verbose_name=_('Label')) initial = models.BooleanField(default=False, help_text=_('Select if this will be the state with which you want the workflow to start in. Only one state can be the initial state.'), verbose_name=_('Initial')) + completion = models.IntegerField(blank=True, default=0, help_text=_('Enter the percent of completion that this state represents in relation to the workflow. Use numbers without the percent sign.'), verbose_name=_('Completion')) def __str__(self): return self.label