mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-12-13 23:05:16 +01:00
Implement signals
This commit is contained in:
@@ -119,6 +119,16 @@ class TransactionAdmin(admin.ModelAdmin):
|
||||
|
||||
poly_destination.short_description = _('destination')
|
||||
|
||||
def get_readonly_fields(self, request, obj=None):
|
||||
"""
|
||||
Only valid can be edited after creation
|
||||
Else the amount of money would not be transferred
|
||||
"""
|
||||
if obj: # user is editing an existing object
|
||||
return 'created_at', 'source', 'destination', 'quantity',\
|
||||
'amount', 'transaction_type'
|
||||
return []
|
||||
|
||||
|
||||
@admin.register(TransactionTemplate)
|
||||
class TransactionTemplateAdmin(admin.ModelAdmin):
|
||||
|
||||
Reference in New Issue
Block a user