2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-08 12:50:55 +00:00

Remove common_currency model entirely

- A lot of views / pages / etc needed to be updated too
- Now uses django-money fields entirely
- Create a manual rate exchange backend (needs more work!)
This commit is contained in:
Oliver Walters
2020-11-11 00:21:06 +11:00
parent 1fc2ef5f18
commit 4dff18e4a6
33 changed files with 194 additions and 422 deletions

View File

@@ -19,8 +19,6 @@ from .models import PartParameterTemplate, PartParameter
from .models import PartTestTemplate
from .models import PartSellPriceBreak
from common.models import Currency
class PartModelChoiceField(forms.ModelChoiceField):
""" Extending string representation of Part instance with available stock """
@@ -298,13 +296,10 @@ class PartPriceForm(forms.Form):
help_text=_('Input quantity for price calculation')
)
currency = forms.ModelChoiceField(queryset=Currency.objects.all(), label='Currency', help_text=_('Select currency for price calculation'))
class Meta:
model = Part
fields = [
'quantity',
'currency',
]
@@ -315,13 +310,10 @@ class EditPartSalePriceBreakForm(HelperForm):
quantity = RoundingDecimalFormField(max_digits=10, decimal_places=5)
cost = RoundingDecimalFormField(max_digits=10, decimal_places=5)
class Meta:
model = PartSellPriceBreak
fields = [
'part',
'quantity',
'cost',
'currency',
'price',
]