Initial claims system setup
This commit is contained in:
32
claims/admin.py
Normal file
32
claims/admin.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Claim, ClaimLog, Project
|
||||
|
||||
|
||||
class ClaimLogInline(admin.TabularInline):
|
||||
model = ClaimLog
|
||||
extra = 0
|
||||
readonly_fields = ("action", "from_status", "to_status", "note", "performed_by", "created_at")
|
||||
can_delete = False
|
||||
|
||||
|
||||
@admin.register(Claim)
|
||||
class ClaimAdmin(admin.ModelAdmin):
|
||||
list_display = ("full_name", "amount", "currency", "project", "status", "created_at", "submitted_by")
|
||||
list_filter = ("status", "created_at", "project")
|
||||
search_fields = ("full_name", "email", "description")
|
||||
readonly_fields = ("created_at", "updated_at")
|
||||
inlines = [ClaimLogInline]
|
||||
|
||||
|
||||
@admin.register(ClaimLog)
|
||||
class ClaimLogAdmin(admin.ModelAdmin):
|
||||
list_display = ("claim", "action", "from_status", "to_status", "performed_by", "created_at")
|
||||
list_filter = ("action", "to_status", "created_at")
|
||||
|
||||
|
||||
@admin.register(Project)
|
||||
class ProjectAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "code", "is_active", "updated_at")
|
||||
list_filter = ("is_active",)
|
||||
search_fields = ("name", "code")
|
||||
Reference in New Issue
Block a user