Add "reference" to build order forms

This commit is contained in:
Oliver Walters 2020-10-19 22:49:28 +11:00
parent a8d47c54f9
commit 0b7cf9e7f3
3 changed files with 16 additions and 3 deletions

View File

@ -17,14 +17,27 @@ class EditBuildForm(HelperForm):
""" Form for editing a Build object. """ Form for editing a Build object.
""" """
field_prefix = {
'reference': 'BO',
'link': 'fa-link',
'batch': 'fa-layer-group',
'location': 'fa-map-marker-alt',
}
field_placeholder = {
'reference': _('Build Order reference')
}
class Meta: class Meta:
model = Build model = Build
fields = [ fields = [
'reference',
'title', 'title',
'part', 'part',
'quantity',
'parent', 'parent',
'sales_order', 'sales_order',
'quantity',
'take_from', 'take_from',
'batch', 'batch',
'link', 'link',

View File

@ -400,7 +400,7 @@ class BuildCreate(AjaxCreateView):
model = Build model = Build
context_object_name = 'build' context_object_name = 'build'
form_class = forms.EditBuildForm form_class = forms.EditBuildForm
ajax_form_title = _('Start new Build') ajax_form_title = _('New Build Order')
ajax_template_name = 'modal_form.html' ajax_template_name = 'modal_form.html'
role_required = 'build.add' role_required = 'build.add'

View File

@ -96,7 +96,7 @@ class EditPurchaseOrderForm(HelperForm):
} }
self.field_placeholder = { self.field_placeholder = {
'reference': _('Enter purchase order number'), 'reference': _('Purchase Order reference'),
} }
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)