diff --git a/core/admin.py b/core/admin.py index e4d4fde..20026cf 100644 --- a/core/admin.py +++ b/core/admin.py @@ -114,10 +114,19 @@ class LoanAdmin(admin.ModelAdmin): @admin.register(PayrollAdjustment) class PayrollAdjustmentAdmin(admin.ModelAdmin): - list_display = ('worker', 'type', 'amount', 'date') + list_display = ('worker', 'type_display', 'amount', 'date') list_filter = ('type', 'date', 'worker') search_fields = ('worker__name', 'description') + # === Type column uses the short user-facing label === + @admin.display(description='Type', ordering='type') + def type_display(self, obj): + """Show the short user-facing label (e.g. "Loan", "Advance") + instead of the raw DB value ("New Loan", "Advance Payment"). + Sorting and filtering still work off the underlying `type` + field — this only changes what's printed in the column.""" + return obj.get_type_display() + class ExpenseLineItemInline(admin.TabularInline): model = ExpenseLineItem extra = 1