From c5a82f4b6eedbd06d6b821af838085dd150108d9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 17 Sep 2019 20:17:25 +1000 Subject: [PATCH] Simplifty PartPriceInfo field --- InvenTree/part/forms.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/InvenTree/part/forms.py b/InvenTree/part/forms.py index 971373ed9b..339c8519fc 100644 --- a/InvenTree/part/forms.py +++ b/InvenTree/part/forms.py @@ -173,23 +173,7 @@ class PartPriceForm(forms.Form): help_text=_('Input quantity for price calculation') ) - currency = forms.ChoiceField(label='Currency', help_text=_('Select currency for price calculation')) - - def get_currency_choices(self): - """ Create options for Currency """ - - currencies = Currency.objects.all() - choices = [(None, '---------')] - - for c in currencies: - choices.append((c.pk, str(c))) - - return choices - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - - self.fields['currency'].choices = self.get_currency_choices() + currency = forms.ModelChoiceField(queryset=Currency.objects.all(), label='Currency', help_text=_('Select currency for price calculation')) class Meta: model = Part