From c8eaf955e0ce92c14380aa13fad66a6b3354c3dd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 11 Oct 2023 12:13:27 +0200 Subject: ✨ imports - match: do not propose "Set to NULL" for required columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/en/changelog_2022-06-15.md | 9 +++++---- changelog/fr/changelog_2023-01-25.md | 9 +++++---- ishtar_common/forms_common.py | 3 ++- ishtar_common/templates/ishtar/formset_import_match.html | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md index 35a3d60ce..aee237d5e 100644 --- a/changelog/en/changelog_2022-06-15.md +++ b/changelog/en/changelog_2022-06-15.md @@ -3,14 +3,15 @@ v4.0.XX - 2099-12-31 ### Features/improvements ### - pre-import forms -- imports form: reorganisation of field order -- import table : +- imports: allow to exclude some errors messages +- imports - form: reorganisation of field order +- imports - table : - built-in CSV viewer - automatic progress refresh - reorganization of fields - improved presentation -- import sheet (links from other sheet to the import sheet) -- import: allow to exclude some errors messages +- imports - sheet (links from other sheet to the import sheet) +- imports - match: do not propose "Set to NULL" for required columns ### Technical ### - update relationship between imports and main items diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md index f60f7331b..711238005 100644 --- a/changelog/fr/changelog_2023-01-25.md +++ b/changelog/fr/changelog_2023-01-25.md @@ -3,14 +3,15 @@ v4.0.XX - 2099-12-31 ### Fonctionnalités/améliorations ### - ajout de formulaire pré-imports -- formulaire d'imports : réorganisation de l'ordre des champs -- table des imports : +- imports : possibilité d'ignorer certains messages d'erreur +- imports - formulaires : réorganisation de l'ordre des champs +- imports - tables : - visualisateur CSV intégré - rafraîchissement automatique de l'avancement - réorganisation des champs - amélioration de la présentation -- fiche d'import (liens des autres fiches vers la fiche import) -- import: possibilité d'ignorer certains messages d'erreur +- imports - fiche (liens des autres fiches vers la fiche import) +- imports - correspondance : ne pas proposer « Mettre à NULL » ### Technique ### - relation de mise à jour entre imports et les éléments principaux diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index cc61f4da7..5ea90a8d5 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -547,7 +547,8 @@ class TargetKeyForm(forms.ModelForm): self.fields["key"].widget.attrs["readonly"] = True self.fields["key"].widget.attrs["title"] = str(instance) self.fields["value"].choices = list(instance.target.get_choices()) - self.fields["value"].choices.insert(1, (self.NULL_VALUE, _("Set to NULL"))) + if not instance.target.column.required: + self.fields["value"].choices.insert(1, (self.NULL_VALUE, _("Set to NULL"))) self.fields["key"].required = False self.fields["target"].required = False diff --git a/ishtar_common/templates/ishtar/formset_import_match.html b/ishtar_common/templates/ishtar/formset_import_match.html index 912577e76..e0a9ea765 100644 --- a/ishtar_common/templates/ishtar/formset_import_match.html +++ b/ishtar_common/templates/ishtar/formset_import_match.html @@ -5,7 +5,7 @@ {% endblock %} {% block pre_container %}
{% csrf_token %} - {% endblock %} +{% endblock %} {% block content %}

{{page_name}}

-- cgit v1.2.3