diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-12-23 16:28:14 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-12-23 16:28:14 +0100 | 
| commit | a9cdecea56b07729496d08abe96f28112fadc151 (patch) | |
| tree | 8f5293c76bd7a4f2cf916f58ce654bb09f1bd6dd /archaeological_operations/forms.py | |
| parent | d5ef58137407b12c91fcf4db479dcd9662efd88d (diff) | |
| download | Ishtar-a9cdecea56b07729496d08abe96f28112fadc151.tar.bz2 Ishtar-a9cdecea56b07729496d08abe96f28112fadc151.zip | |
Document generation for files (refs #1576)
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: | 
