mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-24 07:40:54 +00:00
Update ReceivePurchaseOrder form
- Location field is now a proper MPTT field - Ability to create a new location
This commit is contained in:
InvenTree/order
@ -8,8 +8,11 @@ from __future__ import unicode_literals
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from mptt.fields import TreeNodeChoiceField
|
||||
|
||||
from InvenTree.forms import HelperForm
|
||||
|
||||
from stock.models import StockLocation
|
||||
from .models import PurchaseOrder, PurchaseOrderLineItem
|
||||
|
||||
|
||||
@ -35,6 +38,17 @@ class CancelPurchaseOrderForm(HelperForm):
|
||||
]
|
||||
|
||||
|
||||
class ReceivePurchaseOrderForm(HelperForm):
|
||||
|
||||
location = TreeNodeChoiceField(queryset=StockLocation.objects.all(), required=True, help_text=_('Receive parts to this location'))
|
||||
|
||||
class Meta:
|
||||
model = PurchaseOrder
|
||||
fields = [
|
||||
'location',
|
||||
]
|
||||
|
||||
|
||||
class EditPurchaseOrderForm(HelperForm):
|
||||
""" Form for editing a PurchaseOrder object """
|
||||
|
||||
|
Reference in New Issue
Block a user