2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00
Files
InvenTree/InvenTree/company/forms.py
Matthias Mair e1d22f538d resort imports
2022-05-20 17:24:51 +02:00

49 lines
1009 B
Python

"""
Django Forms for interacting with Company app
"""
import django.forms
from django.utils.translation import gettext_lazy as _
from InvenTree.fields import RoundingDecimalFormField
from InvenTree.forms import HelperForm
from .models import Company, SupplierPriceBreak
class CompanyImageDownloadForm(HelperForm):
"""
Form for downloading an image from a URL
"""
url = django.forms.URLField(
label=_('URL'),
help_text=_('Image URL'),
required=True
)
class Meta:
model = Company
fields = [
'url',
]
class EditPriceBreakForm(HelperForm):
""" Form for creating / editing a supplier price break """
quantity = RoundingDecimalFormField(
max_digits=10,
decimal_places=5,
label=_('Quantity'),
help_text=_('Price break quantity'),
)
class Meta:
model = SupplierPriceBreak
fields = [
'part',
'quantity',
'price',
]