2
0
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:
Oliver Walters
2019-09-23 19:02:36 +10:00
parent 2a31820abe
commit 21e369e6cc
4 changed files with 30 additions and 24 deletions

@ -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 """