mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix target date form field for SalesOrder
This commit is contained in:
parent
2b57ffeb08
commit
b2a732197b
@ -34,7 +34,7 @@ class InvenTreeURLField(models.URLField):
|
||||
})
|
||||
|
||||
|
||||
class InvenTreeDatePickerFormField(forms.DateField):
|
||||
class DatePickerFormField(forms.DateField):
|
||||
"""
|
||||
Custom date-picker field
|
||||
"""
|
||||
|
@ -10,7 +10,7 @@ from django import forms
|
||||
|
||||
from InvenTree.forms import HelperForm
|
||||
from InvenTree.fields import RoundingDecimalFormField
|
||||
from InvenTree.fields import InvenTreeDatePickerFormField
|
||||
from InvenTree.fields import DatePickerFormField
|
||||
|
||||
from .models import Build, BuildItem, BuildOrderAttachment
|
||||
|
||||
@ -35,7 +35,7 @@ class EditBuildForm(HelperForm):
|
||||
'target_date': _('Order target date'),
|
||||
}
|
||||
|
||||
target_date = InvenTreeDatePickerFormField(
|
||||
target_date = DatePickerFormField(
|
||||
help_text=_('Target date for build completion. Build will be overdue after this date.')
|
||||
)
|
||||
|
||||
|
@ -12,6 +12,7 @@ from mptt.fields import TreeNodeChoiceField
|
||||
|
||||
from InvenTree.forms import HelperForm
|
||||
from InvenTree.fields import RoundingDecimalFormField
|
||||
from InvenTree.fields import DatePickerFormField
|
||||
|
||||
from stock.models import StockLocation
|
||||
from .models import PurchaseOrder, PurchaseOrderLineItem, PurchaseOrderAttachment
|
||||
@ -120,6 +121,7 @@ class EditSalesOrderForm(HelperForm):
|
||||
self.field_prefix = {
|
||||
'reference': 'SO',
|
||||
'link': 'fa-link',
|
||||
'target_date': 'fa-calendar-alt',
|
||||
}
|
||||
|
||||
self.field_placeholder = {
|
||||
@ -128,11 +130,8 @@ class EditSalesOrderForm(HelperForm):
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# TODO: Improve this using a better date picker
|
||||
target_date = forms.DateField(
|
||||
widget=forms.DateInput(
|
||||
attrs={'type': 'date'},
|
||||
)
|
||||
target_date = DatePickerFormField(
|
||||
help_text=_('Target date for order completion. Order will be overdue after this date.'),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
Loading…
Reference in New Issue
Block a user