Modify audit exclusions to properly prevent data loss

This commit is contained in:
2020-04-14 20:45:24 +01:00
parent c291a211b0
commit e78a474290
3 changed files with 11 additions and 74 deletions

View File

@@ -21,11 +21,11 @@ class AssetForm(forms.ModelForm):
self.fields['date_acquired'].widget.format = '%Y-%m-%d'
# Needed to prevent assets losing parent data on audit
class AssetAuditForm(AssetForm):
class Meta(AssetForm.Meta):
# TODO Inherit exlcusions from superclass
exclude = ['asset_id_prefix', 'asset_id_number', 'last_audited_at', 'last_audited_by', 'parent']
# Prevents assets losing existing data that isn't included in the audit form
exclude = ['asset_id_prefix', 'asset_id_number', 'last_audited_at', 'last_audited_by',
'parent', 'purchased_from', 'purchase_price', 'comments']
class AssetSearchForm(forms.Form):