From 4d1c74baf591f6e021f7820b381fa962e3317bcd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 8 Sep 2016 12:17:04 +0200 Subject: Filter deadline fields for warehouse manager only (refs #3191) --- archaeological_operations/forms.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'archaeological_operations') diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 0e56aa33b..4564eb37b 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -549,6 +549,13 @@ class OperationSelect(TableSelect): def __init__(self, *args, **kwargs): super(OperationSelect, self).__init__(*args, **kwargs) + if not get_current_profile().warehouse: + self.fields.pop('documentation_deadline_before') + self.fields.pop('documentation_deadline_after') + self.fields.pop('documentation_received') + self.fields.pop('finds_deadline_before') + self.fields.pop('finds_deadline_after') + self.fields.pop('finds_received') self.fields['operation_type'].choices = \ models.OperationType.get_types() self.fields['operation_type'].help_text = \ @@ -836,6 +843,11 @@ class OperationFormGeneral(ManageOldType, forms.Form): def __init__(self, *args, **kwargs): super(OperationFormGeneral, self).__init__(*args, **kwargs) + if not get_current_profile().warehouse: + self.fields.pop('documentation_deadline') + self.fields.pop('documentation_received') + self.fields.pop('finds_deadline') + self.fields.pop('finds_received') self.fields['operation_type'].choices = \ models.OperationType.get_types( initial=self.init_data.get('operation_type')) -- cgit v1.2.3