mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Update refactor for editing PO and SO forms
This commit is contained in:
parent
8fae32e3c7
commit
08d177e55f
@ -39,7 +39,7 @@ class HelperForm(forms.ModelForm):
|
||||
for field in self.fields:
|
||||
prefix = self.prefix.get(field, None)
|
||||
suffix = self.suffix.get(field, None)
|
||||
placeholder = self.placeholder.get(field, None)
|
||||
placeholder = self.placeholder.get(field, '')
|
||||
|
||||
# Look for font-awesome icons
|
||||
if prefix and prefix.startswith('fa-'):
|
||||
|
@ -93,20 +93,16 @@ class EditPurchaseOrderForm(HelperForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
self.prefix = {
|
||||
'reference': 'PO',
|
||||
'link': 'fa-link',
|
||||
}
|
||||
|
||||
# TODO - Refactor this?
|
||||
self.helper.layout = Layout(
|
||||
Field(PrependedText(
|
||||
'reference',
|
||||
'PO',
|
||||
placeholder=_("Purchase Order")
|
||||
)),
|
||||
Field('supplier'),
|
||||
Field('supplier_reference'),
|
||||
Field('description'),
|
||||
Field('link'),
|
||||
)
|
||||
self.placeholder = {
|
||||
'reference': _('Enter purchase order number'),
|
||||
}
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
class Meta:
|
||||
model = PurchaseOrder
|
||||
@ -124,20 +120,16 @@ class EditSalesOrderForm(HelperForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
self.prefix = {
|
||||
'reference': 'SO',
|
||||
'link': 'fa-link',
|
||||
}
|
||||
|
||||
# TODO - Refactor?
|
||||
self.helper.layout = Layout(
|
||||
Field(PrependedText(
|
||||
'reference',
|
||||
'SO',
|
||||
placeholder=_("Sales Order")
|
||||
)),
|
||||
Field('customer'),
|
||||
Field('customer_reference'),
|
||||
Field('description'),
|
||||
Field('link'),
|
||||
)
|
||||
self.placeholder = {
|
||||
'reference': _('Enter sales order number'),
|
||||
}
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
class Meta:
|
||||
model = SalesOrder
|
||||
|
Loading…
Reference in New Issue
Block a user