|
|
|
@ -46,6 +46,11 @@ class AccountAdmin(admin.ModelAdmin):
@@ -46,6 +46,11 @@ class AccountAdmin(admin.ModelAdmin):
|
|
|
|
|
}), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# Disable manual creation of accounts. |
|
|
|
|
# Accounts are create after user creation automatically. |
|
|
|
|
def has_add_permission(self, request): |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
def transaction_link(self, account): |
|
|
|
|
return '<a href="%s?account__id__exact=%d">%s</a>' % \ |
|
|
|
|
(reverse("admin:cashonly_transaction_changelist"), account.id, |
|
|
|
@ -111,7 +116,10 @@ class SalesLogEntryAdmin(admin.ModelAdmin):
@@ -111,7 +116,10 @@ class SalesLogEntryAdmin(admin.ModelAdmin):
|
|
|
|
|
class TransactionAdmin(admin.ModelAdmin): |
|
|
|
|
list_display = ('account', 'timestamp', 'subject', 'description', 'amount') |
|
|
|
|
list_filter = ['account', 'timestamp', 'subject'] |
|
|
|
|
|
|
|
|
|
# Disable mass deletion in the overview page |
|
|
|
|
actions = None |
|
|
|
|
|
|
|
|
|
date_hierarchy = 'timestamp' |
|
|
|
|
|
|
|
|
|
# Disable tampering with the transactions completely. |
|
|
|
|