InvenTree/InvenTree/order/forms.py

64 lines
1.3 KiB
Python
Raw Normal View History

"""
Django Forms for interacting with Order objects
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2019-06-10 12:14:23 +00:00
from django import forms
from django.utils.translation import ugettext as _
2019-06-10 12:14:23 +00:00
from InvenTree.forms import HelperForm
from .models import PurchaseOrder, PurchaseOrderLineItem
class IssuePurchaseOrderForm(HelperForm):
confirm = forms.BooleanField(required=False, help_text=_('Place order'))
2019-06-10 12:14:23 +00:00
class Meta:
model = PurchaseOrder
fields = [
2019-06-10 12:14:23 +00:00
'confirm',
]
class CancelPurchaseOrderForm(HelperForm):
confirm = forms.BooleanField(required=False, help_text=_('Cancel order'))
class Meta:
model = PurchaseOrder
fields = [
'confirm',
]
class EditPurchaseOrderForm(HelperForm):
""" Form for editing a PurchaseOrder object """
class Meta:
model = PurchaseOrder
fields = [
'reference',
'supplier',
'description',
'URL',
'notes'
]
class EditPurchaseOrderLineItemForm(HelperForm):
""" Form for editing a PurchaseOrderLineItem object """
class Meta:
model = PurchaseOrderLineItem
fields = [
'order',
'part',
'quantity',
'reference',
'notes',
2019-06-05 11:56:52 +00:00
]