diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-11 17:24:09 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-19 14:45:57 +0100 |
commit | c5636472f93f7d421f2dce56383ad219205f2847 (patch) | |
tree | cea8a0d821059095fc83aaaa019554ebf5321f19 | |
parent | 847ae9bab5afbc2d62fa6e4b1e751096e74e4c4d (diff) | |
download | Ishtar-c5636472f93f7d421f2dce56383ad219205f2847.tar.bz2 Ishtar-c5636472f93f7d421f2dce56383ad219205f2847.zip |
✨ operations searches: add "Result considered negative" field
-rw-r--r-- | archaeological_operations/forms.py | 6 | ||||
-rw-r--r-- | archaeological_operations/models.py | 7 | ||||
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_operation.html | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 88c0b9c84..a7d191dd8 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -468,6 +468,7 @@ class SiteOpeRelationsForm(ManageOldType): associated_model=models.Operation), validators=[valid_id(models.Operation)], required=False) + SiteOpeRelationsFormSet = formset_factory( SiteOpeRelationsForm, can_delete=True, formset=RecordRelationsFormSetBase, extra=3 @@ -541,6 +542,7 @@ class OperationSelect(GeoItemSelect): abstract = forms.CharField(label=_("Abstract (full text search)")) scientific_documentation_comment = forms.CharField( label=_("Comment about scientific documentation")) + negative_result = forms.NullBooleanField(label=_("Result considered negative")) record_quality_type = forms.ChoiceField(label=_("Record quality")) report_processing = forms.ChoiceField(label=_("Report processing"), choices=[]) @@ -782,8 +784,6 @@ class OperationFormGeneral(CustomForm, ManageOldType): choices=[], required=False) if settings.COUNTRY == 'fr': cira_date = DateField(label="Date avis CTRA/CIRA", required=False) - negative_result = forms.NullBooleanField( - required=False, label="Résultat considéré comme négatif") cira_rapporteur = forms.IntegerField( label="Rapporteur CTRA/CIRA", widget=widgets.JQueryAutoComplete( @@ -797,6 +797,8 @@ class OperationFormGeneral(CustomForm, ManageOldType): tips=lazy(get_sra_agent_head_scientist_label), associated_model=Person, new=True), validators=[valid_id(Person)], required=False) + negative_result = forms.NullBooleanField( + required=False, label=_("Result considered negative")) documentation_deadline = DateField( label=_("Deadline for submission of the documentation"), required=False) diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index a4feca974..093959fbe 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1199,6 +1199,7 @@ class Operation( "virtual_operation", "documentation_received", "finds_received", + "negative_result", ] MANY_COUNTED_FIELDS = ["context_record__base_finds__isnull"] REVERSED_BOOL_FIELDS = [ @@ -1469,6 +1470,10 @@ class Operation( "drassm_code__iexact", related_name="drassm_code" ), + "negative_result": SearchAltName( + pgettext_lazy("key for text search", "negative-result"), + "negative_result", + ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) ALT_NAMES.update(DocumentItem.ALT_NAMES) @@ -1671,7 +1676,7 @@ class Operation( verbose_name="Rapporteur CTRA/CIRA", ) negative_result = models.NullBooleanField( - "Résultat considéré comme négatif", blank=True, null=True + _("Result considered negative"), blank=True, null=True ) cira_date = models.DateField("Date avis CTRA/CIRA", null=True, blank=True) eas_number = models.CharField( diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 86c425979..6d5fa18e5 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -265,7 +265,7 @@ {% endwith %} {% field_flex_detail "Associated file" item.associated_file %} - {% field_flex "Résultat considéré comme négatif" item.negative_result %} + {% field_flex _("Result considered negative") item.negative_result %} {% field_flex_detail "Rapporteur CTRA/CIRA" item.cira_rapporteur %} {% with cira_date=item.cira_date|date:"DATE_FORMAT"|default:"" %} {% field_flex "Date avis CTRA/CIRA" cira_date %} |