diff --git a/mayan/apps/metadata/forms.py b/mayan/apps/metadata/forms.py index df5e69bb6a..970e892d4f 100644 --- a/mayan/apps/metadata/forms.py +++ b/mayan/apps/metadata/forms.py @@ -16,15 +16,17 @@ class MetadataForm(forms.Form): widget=forms.TextInput(attrs={'readonly': 'readonly'}) ) value = forms.CharField(label=_('Value'), required=False) - update = forms.BooleanField( - initial=True, label=_('Update'), required=False - ) def __init__(self, *args, **kwargs): + self.disable_update_column = kwargs.pop('disable_update_column', False) super(MetadataForm, self).__init__(*args, **kwargs) # Set form fields initial values if 'initial' in kwargs: + if not kwargs['initial'].get('disable_update_column', False): + self.fields['update'] = forms.BooleanField( + initial=True, label=_('Update'), required=False + ) self.metadata_type = kwargs['initial']['metadata_type'] self.document_type = kwargs['initial']['document_type'] required_string = '' diff --git a/mayan/apps/sources/wizards.py b/mayan/apps/sources/wizards.py index 47f74d2a3c..cf799a6e41 100644 --- a/mayan/apps/sources/wizards.py +++ b/mayan/apps/sources/wizards.py @@ -59,6 +59,7 @@ class DocumentCreateWizard(ViewPermissionCheckMixin, SessionWizardView): for document_type_metadata_type in self.get_cleaned_data_for_step('0')['document_type'].metadata.all(): initial.append({ + 'disable_update_column': True, 'document_type': self.get_cleaned_data_for_step('0')['document_type'], 'metadata_type': document_type_metadata_type.metadata_type, })