diff options
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index e52fef927..d9f5ece9b 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -620,10 +620,14 @@ class DocumentGenerationAdminActForm(forms.Form): document_template = forms.ChoiceField(label=_("Template"), choices=[]) def __init__(self, *args, **kwargs): + document_type = 'O' + if 'operation' in kwargs: + document_type = 'O' if kwargs.pop('operation') else 'F' super(DocumentGenerationAdminActForm, self).__init__(*args, **kwargs) self.fields['document_template'].choices = DocumentTemplate.get_tuples( dct={'associated_object_name': - 'archaeological_operations.models.AdministrativeAct'}) + 'archaeological_operations.models.AdministrativeAct', + 'acttypes__intented_to':document_type}) def save(self, object_pk): try: |