diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-02-07 18:30:32 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-02-07 18:30:32 +0100 | 
| commit | f4f80f3b5f716fea97cfa58612ef1d04ada378c1 (patch) | |
| tree | 62969040e9bd32fd40ab46494bbcdcdb3957c5f3 | |
| parent | e9be88dbd17c87a124eced9563dfbdbc7e25f806 (diff) | |
| download | Ishtar-f4f80f3b5f716fea97cfa58612ef1d04ada378c1.tar.bz2 Ishtar-f4f80f3b5f716fea97cfa58612ef1d04ada378c1.zip | |
Minor fixes: fix field name on doc dup - more explicit resume on deletion
| -rw-r--r-- | ishtar_common/forms_common.py | 2 | ||||
| -rw-r--r-- | ishtar_common/models_common.py | 4 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/delete_wizard.html | 2 | ||||
| -rw-r--r-- | ishtar_common/wizards.py | 5 | 
4 files changed, 8 insertions, 5 deletions
| diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 935436eaa..0e4cc68db 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -2068,7 +2068,7 @@ class QADocumentFormMulti(QAForm):  class QADocumentDuplicateForm(IshtarForm): -    qa_title = forms.CharField(label=_("Reference"), max_length=500, required=False) +    qa_title = forms.CharField(label=_("Title"), max_length=500, required=False)      qa_source_type = forms.ChoiceField(label=_("Type"), choices=[], required=False)      TYPES = [ diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index b605d13f2..109174439 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -3122,6 +3122,10 @@ class MainItem(ShortMenuItem):      QUICK_ACTIONS = []      @classmethod +    def class_verbose_name(cls): +        return cls._meta.verbose_name + +    @classmethod      def get_quick_actions(cls, user, session=None, obj=None):          """          Get a list of (url, title, icon, target) actions for an user diff --git a/ishtar_common/templates/ishtar/wizard/delete_wizard.html b/ishtar_common/templates/ishtar/wizard/delete_wizard.html index 9b925f143..625b7a823 100644 --- a/ishtar_common/templates/ishtar/wizard/delete_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/delete_wizard.html @@ -7,7 +7,7 @@          {% if current_objs and current_objs.1 %}          {% trans "Are you sure to want to delete these items?" %}          <ul>{% for obj in current_objs %} -            <li>{{obj}}</li> +            <li>{{obj.class_verbose_name}} - {{obj}}</li>          {% endfor %}</ul>          {% else %}          {% trans "Are you sure to want to delete this item?" %}{% endif %} diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 7b636538d..4a8fb9a8d 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1774,15 +1774,14 @@ class MultipleDeletionWizard(MultipleItemWizard):                      value = str(value)                  res[field.name] = (label, value, "")              full_res.append(res) -        if not datas and self.fields: -            datas = [["", []]]          datas = []          for idx, res in enumerate(full_res):              data = []              for field in self.fields:                  if field in res:                      data.append(res[field]) -            datas.append((str(self.current_objs[idx]), data)) +            obj = self.current_objs[idx] +            datas.append((f"{obj.class_verbose_name()} - {obj}", data))          return datas      def get_context_data(self, form, **kwargs): | 
