summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
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
commit2c7009c401d188d54add9eea91f267f9a2702cfb (patch)
tree8f5293c76bd7a4f2cf916f58ce654bb09f1bd6dd /archaeological_operations/forms.py
parentb4dd6850d5bbe0e75bdcdfdd7d06ff28d3ebfc99 (diff)
downloadIshtar-2c7009c401d188d54add9eea91f267f9a2702cfb.tar.bz2
Ishtar-2c7009c401d188d54add9eea91f267f9a2702cfb.zip
Document generation for files (refs #1576)
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py6
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: