74 lines
1.9 KiB
Python
74 lines
1.9 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from core.apps.evaluation.models import ValuationModel
|
|
|
|
|
|
@admin.register(ValuationModel)
|
|
class ValuationAdmin(ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"conclusion_number",
|
|
"evaluation_type",
|
|
"status",
|
|
"customer",
|
|
"assigned_to",
|
|
"estimated_price",
|
|
"final_price",
|
|
"payment_status",
|
|
"created_at",
|
|
)
|
|
list_filter = (
|
|
"evaluation_type",
|
|
"status",
|
|
"payment_status",
|
|
"evaluation_purpose",
|
|
"is_courier_delivery",
|
|
)
|
|
search_fields = (
|
|
"conclusion_number",
|
|
"customer__first_name",
|
|
"customer__last_name",
|
|
"customer__org_name",
|
|
"customer__inn",
|
|
)
|
|
readonly_fields = ("created_at", "updated_at")
|
|
raw_id_fields = ("customer", "property_owner", "created_by", "assigned_to")
|
|
fieldsets = (
|
|
("Asosiy ma'lumotlar", {
|
|
"fields": (
|
|
"conclusion_number",
|
|
("evaluation_type", "evaluation_subtype"),
|
|
"evaluation_purpose",
|
|
"status",
|
|
),
|
|
}),
|
|
("Bog'lanishlar", {
|
|
"fields": (
|
|
"customer",
|
|
"property_owner",
|
|
"created_by",
|
|
"assigned_to",
|
|
),
|
|
}),
|
|
("Narx va To'lov", {
|
|
"fields": (
|
|
("estimated_price", "final_price"),
|
|
"payment_status",
|
|
),
|
|
}),
|
|
("Yetkazib berish", {
|
|
"fields": (
|
|
"is_courier_delivery",
|
|
"courier_extra_amount",
|
|
),
|
|
}),
|
|
("Qo'shimcha", {
|
|
"fields": ("notes",),
|
|
}),
|
|
("Tizim", {
|
|
"classes": ("collapse",),
|
|
"fields": ("created_at", "updated_at"),
|
|
}),
|
|
)
|