diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/forms_common.py | 1 | ||||
| -rw-r--r-- | ishtar_common/models.py | 2 | ||||
| -rw-r--r-- | ishtar_common/views.py | 5 | 
3 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index d34c0d23f..b8272a9f3 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1202,6 +1202,7 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType):      form_admin_name = _("Document - General")      form_slug = "document-general"      file_upload = True +    extra_form_modals = ["author", "person", "organization"]      associated_models = {'source_type': models.SourceType}      pk = forms.IntegerField(label="", required=False, widget=forms.HiddenInput) diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 2a50533db..cb1325af1 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2047,7 +2047,7 @@ class TemplateItem:              "models_treatments", "models")          if alt_model_name != model_name:              q |= Q(associated_model__klass=model_name, -              for_labels=True, available=True) +                   for_labels=True, available=True)          return DocumentTemplate.objects.filter(q)      @classmethod diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 33446ec8b..44831ba9f 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1886,6 +1886,11 @@ class DocumentFormMixin(IshtarMixin, LoginRequiredMixin):      template_name = 'ishtar/forms/document.html'      model = models.Document +    def get_context_data(self, **kwargs): +        data = super(DocumentFormMixin, self).get_context_data(**kwargs) +        data["extra_form_modals"] = self.form_class.extra_form_modals +        return data +      def get_success_url(self):          return reverse("edit-document") + "?open_item={}".format(self.object.pk)  | 
