From 6af1010f3aef3a69f8dbb83c5c894a9575805b1a Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 12 Jun 2017 16:16:03 -0400 Subject: [PATCH] Preload metadata add form with metadata type valid for the context document. Signed-off-by: Roberto Rosario --- mayan/apps/metadata/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mayan/apps/metadata/views.py b/mayan/apps/metadata/views.py index 47c445b4e7..222d204c27 100644 --- a/mayan/apps/metadata/views.py +++ b/mayan/apps/metadata/views.py @@ -127,7 +127,9 @@ class DocumentMetadataAddView(MultipleObjectFormActionView): if queryset.count() == 1: result.update( { - 'queryset': MetadataType.objects.exclude( + 'queryset': MetadataType.objects.get_for_document_type( + document_type=queryset.first().document_type + ).exclude( pk__in=MetadataType.objects.get_for_document( document=queryset.first() )