diff --git a/shimatta_kenkyusho/parts/forms.py b/shimatta_kenkyusho/parts/forms.py index 1cbfbae..504d763 100644 --- a/shimatta_kenkyusho/parts/forms.py +++ b/shimatta_kenkyusho/parts/forms.py @@ -79,6 +79,7 @@ class AddStockForm(forms.Form): watermark = forms.IntegerField(min_value=0, required=True, initial=0) amount = forms.IntegerField(min_value=0, required=True, initial=1) component_uuid = forms.UUIDField(required=True) + lot = forms.CharField(max_length=255, required=False) def clean(self): cleaned_data = super().clean() @@ -103,7 +104,7 @@ class AddStockForm(forms.Form): if self.cleaned_data.get('watermark_active'): watermark = self.cleaned_data.get('watermark') - new_stock = parts_models.Stock.objects.create(storage=storage, component=component, watermark=watermark, amount=amount) + new_stock = parts_models.Stock.objects.create(storage=storage, component=component, watermark=watermark, amount=amount, lot=self.cleaned_data['lot']) new_stock.save() class EditComponentForm(forms.Form): diff --git a/shimatta_kenkyusho/templates/parts/modals/add-stock-modal.html b/shimatta_kenkyusho/templates/parts/modals/add-stock-modal.html index a617aa7..d9755bd 100644 --- a/shimatta_kenkyusho/templates/parts/modals/add-stock-modal.html +++ b/shimatta_kenkyusho/templates/parts/modals/add-stock-modal.html @@ -33,6 +33,15 @@ Input context: {% endfor %} +