diff options
-rw-r--r-- | archaeological_operations/forms.py | 9 | ||||
-rw-r--r-- | archaeological_operations/views.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index bca08230f..cb4b52fe3 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -392,6 +392,13 @@ class OperationFormGeneral(forms.Form): raise forms.ValidationError(msg) return self.cleaned_data +class OperationFormModifGeneral(OperationFormGeneral): + operation_code = forms.IntegerField(label=_(u"Operation code"), + initial=models.Operation.get_available_operation_code) + def __init__(self, *args, **kwargs): + super(OperationFormGeneral, self).__init__(*args, **kwargs) + self.fields['operation_code'].widget.attrs['readonly'] = True + class OperationFormPreventive(forms.Form): form_label = _(u"Preventive informations - excavation") cost = forms.IntegerField(label=_(u"Cost (€)"), required=False) diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index a957fe8c1..b0676b45c 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -203,7 +203,7 @@ operation_creation_wizard = OperationWizard.as_view([ operation_modification_wizard = OperationModificationWizard.as_view([ ('selec-operation_modification', OperationFormSelection), - ('general-operation_modification', OperationFormGeneral), + ('general-operation_modification', OperationFormModifGeneral), ('preventive-operation_modification', OperationFormPreventive), ('preventivediag-operation_modification', OperationFormPreventiveDiag), ('towns-operation_modification', SelectedTownFormset), |