From 8d7ed2a8208a1d3422e4827a35fa7d6cb7f59cee Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 21 Jan 2021 17:50:51 +0100 Subject: Fix migration of new containers - add collection field --- archaeological_warehouse/forms.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'archaeological_warehouse/forms.py') diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 42b8e1749..110f01c9b 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -265,6 +265,7 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): extra_form_modals = ["warehouse", "organization", "person", "container"] associated_models = {'container_type': models.ContainerType, 'location': models.Warehouse, + 'collection': models.Warehouse, 'parent': models.Container} reference = forms.CharField(label=_("Ref."), max_length=200) old_reference = forms.CharField(label=_("Old reference"), required=False, @@ -285,6 +286,15 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): validators=[valid_id(models.Container)], required=False ) + collection = forms.IntegerField( + label=_("Collection"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-warehouse'), + associated_model=models.Warehouse, new=True), + validators=[valid_id(models.Warehouse)], + help_text=_("Automatically attached to the current warehouse if not " + "filled.") + ) comment = forms.CharField(label=_("Comment"), widget=forms.Textarea, required=False) TYPES = [ -- cgit v1.2.3