forked from erp-dev/erp
feat: completed
This commit is contained in:
22
cost/admin.py
Normal file
22
cost/admin.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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')
|
||||
Reference in New Issue
Block a user