From 7bc043c6e96706baa8ffff66d910437aea4492ec Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 3 Dec 2020 16:14:20 +0100 Subject: Container QA form: fix parent add - fix field layout (refs #4996 - refs #4997) --- archaeological_warehouse/forms.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'archaeological_warehouse') diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 9ff09bde4..5fcc105cd 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -266,10 +266,10 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): associated_models = {'container_type': models.ContainerType, 'location': models.Warehouse, 'parent': models.Container} - reference = forms.CharField(label=_(u"Ref."), max_length=200) - old_reference = forms.CharField(label=_(u"Old reference"), required=False, + reference = forms.CharField(label=_("Ref."), max_length=200) + old_reference = forms.CharField(label=_("Old reference"), required=False, max_length=200) - container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) + container_type = forms.ChoiceField(label=_("Container type"), choices=[]) location = forms.IntegerField( label=_("Current location (warehouse)"), widget=widgets.JQueryAutoComplete( @@ -333,6 +333,7 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): dct['container_type'] = models.ContainerType.objects.get( pk=dct['container_type']) dct['location'] = models.Warehouse.objects.get(pk=dct['location']) + dct['parent'] = models.Container.objects.get(pk=dct['parent']) new_item = models.Container(**dct) new_item.save() return new_item -- cgit v1.2.3