diff options
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
| -rw-r--r-- | archaeological_finds/forms_treatments.py | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index aacd73bc8..8832426f5 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -1259,6 +1259,9 @@ class QAStatementCondition(ManageOldType, forms.Form): "qa_conservatory_states", "qa_museum_marking_type", "qa_museum_inventory_marking_presence", + "qa_object_types", + "qa_material_types", + "qa_technical_processes", ] associated_models = { "qa_alterations": models.AlterationType, @@ -1269,6 +1272,9 @@ class QAStatementCondition(ManageOldType, forms.Form): "qa_integrities": models.IntegrityType, "follow_up_action": models.FollowUpActionType, "statement_condition_type_id": models.StatementConditionType, + "qa_object_types": models.ObjectType, + "qa_material_types": models.MaterialType, + "qa_technical_processes": models.TechnicalProcessType, "qa_museum_marking_type": models.MarkingType, "qa_museum_inventory_marking_presence": models.InventoryMarkingPresence, "qa_museum_inventory_conformity_id": models.InventoryConformity, @@ -1309,7 +1315,29 @@ class QAStatementCondition(ManageOldType, forms.Form): observations = forms.CharField(label=_("Observations"), widget=forms.Textarea, required=False) - HEADERS["qa_description"] = FormHeader(_("Find")) + HEADERS["qa_denomination"] = FormHeader(_("Find")) + qa_denomination = forms.CharField( + label=_("Denomination"), widget=forms.Textarea, + required=False) + qa_object_types = widgets.Select2MultipleField( + label=_("Object types"), + required=False, + ) + qa_object_type_quality_id = forms.ChoiceField( + label=_("Object type quality"), choices=[], required=False) + qa_material_types = widgets.Select2MultipleField( + label=_("Material types"), required=False + ) + qa_material_type_quality_id = forms.ChoiceField( + label=_("Material type quality"), choices=[], required=False + ) + qa_material_comment = forms.CharField( + label=_("Comment on the material"), widget=forms.Textarea, required=False + ) + qa_technical_processes = widgets.Select2MultipleField( + label=_("Technical processes"), + required=False, + ) qa_description = forms.CharField( label=_("Description"), widget=forms.Textarea, required=False ) @@ -1341,6 +1369,9 @@ class QAStatementCondition(ManageOldType, forms.Form): qa_museum_inventory_quantity = forms.IntegerField(label=_("Inventory quantity"), required=False, max_value=32000) qa_museum_observed_quantity = forms.IntegerField( label=_("Observed quantity"), required=False) + qa_quantity_comment = forms.CharField( + label=_("Comment on quantity"), widget=forms.Textarea, + required=False) qa_length = FloatField( label=_("Length (cm)"), widget=widgets.CentimeterMeterWidget, required=False ) @@ -1397,6 +1428,10 @@ class QAStatementCondition(ManageOldType, forms.Form): widget=widgets.Select2Multiple, required=False, ) + qa_conservatory_states_details = forms.CharField( + label=_("Conservatory state details"), required=False, + widget=forms.Textarea + ) qa_alterations = forms.MultipleChoiceField( label=_("Alteration"), choices=[], @@ -1409,6 +1444,10 @@ class QAStatementCondition(ManageOldType, forms.Form): widget=widgets.Select2Multiple, required=False, ) + qa_alteration_comment = forms.CharField( + label=_("Details regards alterations"), required=False, + widget=forms.Textarea + ) qa_recommended_treatments = forms.MultipleChoiceField( label=_("Recommended treatments"), choices=[], @@ -1436,6 +1475,14 @@ class QAStatementCondition(ManageOldType, forms.Form): empty_first=False), FieldType("qa_treatment_emergency_id", models.TreatmentEmergencyType), FieldType("qa_museum_inventory_conformity_id", models.InventoryConformity), + FieldType("qa_object_types", models.ObjectType, + is_multiple=True), + FieldType("qa_material_types", models.MaterialType, + is_multiple=True), + FieldType("qa_technical_processes", models.TechnicalProcessType, + is_multiple=True), + FieldType("qa_object_type_quality_id", models.ObjectTypeQualityType), + FieldType("qa_material_type_quality_id", models.MaterialTypeQualityType), ] PROFILE_FILTER = { "museum": ["qa_museum_observed_quantity", "qa_museum_marking_type", @@ -1459,7 +1506,7 @@ class QAStatementCondition(ManageOldType, forms.Form): def save(self): data = copy(self.cleaned_data) data["find_id"] = self.current_item.pk - applied = data.pop("applied") + applied = data["applied"] follow_up_actions = data.pop("follow_up_action") # remove m2m fields m2m = {} @@ -1497,5 +1544,4 @@ class QAStatementCondition(ManageOldType, forms.Form): if applied == "D": # draft exit return - st.applied = applied st.apply_validation() |
