forked from erp-dev/erp
22 lines
779 B
Python
22 lines
779 B
Python
from django.contrib import admin
|
|
|
|
from . import models
|
|
|
|
|
|
@admin.register(models.CostCategory)
|
|
class CostCategoryAdmin(admin.ModelAdmin):
|
|
list_display = ('id', 'merchant', 'unique_key', 'name', 'parent', 'created_at')
|
|
search_fields = ('name', 'unique_key')
|
|
list_filter = ('merchant', 'created_at')
|
|
ordering = ('merchant', 'name')
|
|
|
|
|
|
@admin.register(models.CostEntry)
|
|
class CostEntryAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
'id', 'merchant', 'category', 'amount', 'occurred_at',
|
|
'operator', 'source_module', 'source_id', 'created_at',
|
|
)
|
|
search_fields = ('category__name', 'source_module', 'source_id')
|
|
list_filter = ('merchant', 'category', 'occurred_at', 'source_module', 'created_at')
|
|
ordering = ('-occurred_at', '-created_at') |