<commit_before>"""Admin classes for the account_keeping app."""
from django.contrib import admin

from . import models


class CurrencyAdmin(admin.ModelAdmin):
    list_display = ['name', 'iso_code', 'is_base_currency']
admin.site.register(models.Currency, CurrencyAdmin)


class CurrencyRateAdmin(admin.ModelAdmin):
    list_display = ['currency', 'year', 'month', 'rate']
admin.site.register(models.CurrencyRate, CurrencyRateAdmin)


class AccountAdmin(admin.ModelAdmin):
    list_display = [
        'name', 'slug', 'currency', 'initial_amount', 'total_amount']
admin.site.register(models.Account, AccountAdmin)


class InvoiceAdmin(admin.ModelAdmin):
    list_display = [
        'invoice_type', 'invoice_date', 'currency', 'amount_net', 'vat',
        'amount_gross', 'payment_date']
    list_filter = ['invoice_type', 'currency', ]
    date_hierarchy = 'invoice_date'
admin.site.register(models.Invoice, InvoiceAdmin)


class PayeeAdmin(admin.ModelAdmin):
    list_display = ['name', ]
admin.site.register(models.Payee, PayeeAdmin)


class CategoryAdmin(admin.ModelAdmin):
    list_display = ['name', ]
admin.site.register(models.Category, CategoryAdmin)


class TransactionAdmin(admin.ModelAdmin):
    list_display = [
        'transaction_date', 'invoice_number', 'invoice', 'payee', 'category',
        'currency', 'value_net', 'vat', 'value_gross', ]
    list_filter = ['account', 'payee', 'category', ]
    date_hierarchy = 'transaction_date'
    raw_id_fields = ['parent', 'invoice']
    search_fields = [
        'invoice_number', 'invoice__invoice_number', 'description']
admin.site.register(models.Transaction, TransactionAdmin)
<commit_msg>Added search_fields to invoice admin<commit_after>"""Admin classes for the account_keeping app."""
from django.contrib import admin

from . import models


class CurrencyAdmin(admin.ModelAdmin):
    list_display = ['name', 'iso_code', 'is_base_currency']
admin.site.register(models.Currency, CurrencyAdmin)


class CurrencyRateAdmin(admin.ModelAdmin):
    list_display = ['currency', 'year', 'month', 'rate']
admin.site.register(models.CurrencyRate, CurrencyRateAdmin)


class AccountAdmin(admin.ModelAdmin):
    list_display = [
        'name', 'slug', 'currency', 'initial_amount', 'total_amount']
admin.site.register(models.Account, AccountAdmin)


class InvoiceAdmin(admin.ModelAdmin):
    list_display = [
        'invoice_type', 'invoice_date', 'currency', 'amount_net', 'vat',
        'amount_gross', 'payment_date']
    list_filter = ['invoice_type', 'currency', ]
    date_hierarchy = 'invoice_date'
    search_fields = ['invoice_number', 'description']
admin.site.register(models.Invoice, InvoiceAdmin)


class PayeeAdmin(admin.ModelAdmin):
    list_display = ['name', ]
admin.site.register(models.Payee, PayeeAdmin)


class CategoryAdmin(admin.ModelAdmin):
    list_display = ['name', ]
admin.site.register(models.Category, CategoryAdmin)


class TransactionAdmin(admin.ModelAdmin):
    list_display = [
        'transaction_date', 'invoice_number', 'invoice', 'payee', 'category',
        'currency', 'value_net', 'vat', 'value_gross', ]
    list_filter = ['account', 'payee', 'category', ]
    date_hierarchy = 'transaction_date'
    raw_id_fields = ['parent', 'invoice']
    search_fields = [
        'invoice_number', 'invoice__invoice_number', 'description']
admin.site.register(models.Transaction, TransactionAdmin)

{'fraction_non_alphanumeric': 0.14104455591619947, 'fraction_numerical': 0.0, 'mean_word_length': 5.2430939226519335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7356855', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1035, 'n_words': 199}