konova/compensation/admin.py
mipel 6a650d2021 Eco Accounts
* adds related eco account withdraw detail view to intervention detail view
* adds new route for removing withdraws using RemoveModalForm
* adds EcoAccountWithdraw model
* adds admin interfaces for EcoAccount and EcoAccountWithdraw
* adds message_templates.py to konova/utils for reusable messages
* splits related-documents.html and related-objects.html into separate templates for each related object type: compensations.html, documents.html, eco-account-withdraws.html and payments.html
* adds translations
2021-08-02 10:14:34 +02:00

83 lines
1.7 KiB
Python

from django.contrib import admin
from compensation.models import Compensation, CompensationAction, CompensationState, CompensationControl, Payment, \
EcoAccountWithdraw, EcoAccount
class CompensationControlAdmin(admin.ModelAdmin):
list_display = [
"id",
"type",
"deadline",
"expected_result",
"by_authority",
]
class CompensationStateAdmin(admin.ModelAdmin):
list_display = [
"id",
"biotope_type",
"surface",
]
class CompensationActionAdmin(admin.ModelAdmin):
list_display = [
"id",
"action_type",
"amount",
"unit",
"control",
]
class CompensationAdmin(admin.ModelAdmin):
list_display = [
"id",
"identifier",
"title",
"created_on",
"created_by",
]
class EcoAccountAdmin(admin.ModelAdmin):
list_display = [
"id",
"identifier",
"title",
"created_on",
"created_by",
]
class PaymentAdmin(admin.ModelAdmin):
list_display = [
"id",
"amount",
"due_on",
"created_by",
"created_on",
]
class EcoAccountWithdrawAdmin(admin.ModelAdmin):
list_display = [
"id",
"account",
"intervention",
"amount",
"created_by",
"created_on",
]
admin.site.register(Compensation, CompensationAdmin)
admin.site.register(Payment, PaymentAdmin)
admin.site.register(CompensationAction, CompensationActionAdmin)
admin.site.register(CompensationState, CompensationStateAdmin)
admin.site.register(CompensationControl, CompensationControlAdmin)
admin.site.register(EcoAccount, EcoAccountAdmin)
admin.site.register(EcoAccountWithdraw, EcoAccountWithdrawAdmin)