buttons in table footer
This commit is contained in:
+8
-6
@@ -25,9 +25,11 @@ class ContainerExpeditionForm(ContainerBaseForm):
|
||||
Inherits from ContainerBaseForm.
|
||||
"""
|
||||
class Meta(ContainerBaseForm.Meta):
|
||||
exclude = ['created_on',
|
||||
'created_by',
|
||||
'deleted',
|
||||
'deleted_on',
|
||||
'deleted_by',
|
||||
'received'] # Exclude fields that should not be set by the user
|
||||
fields = ['number', 'expedition_vehicle', 'position', 'line', 'container_type', 'damages', 'heavy_damaged']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
readonly_fields = ['number', 'position', 'line', 'container_type', 'damages', 'heavy_damaged']
|
||||
for field in readonly_fields:
|
||||
self.fields[field].widget.attrs['readonly'] = True
|
||||
self.fields[field].disabled = True
|
||||
Reference in New Issue
Block a user