From dad1d5ede845d4c900433f8c6134e65aa280ad91 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Wed, 27 Aug 2025 12:10:13 +0500 Subject: [PATCH] change: change all admins --- core/apps/accounts/admin/user.py | 2 +- core/apps/company/admin/branch.py | 2 +- core/apps/company/admin/company.py | 2 +- core/apps/orders/admin/party.py | 2 +- core/apps/products/admin/product.py | 2 +- core/apps/products/admin/unity.py | 2 +- core/apps/projects/admin/project.py | 5 ++--- core/apps/shared/admin/region.py | 4 ++-- core/apps/wherehouse/admin/invalid_product.py | 2 +- core/apps/wherehouse/admin/stock_movement.py | 2 +- core/apps/wherehouse/admin/wherehouse.py | 2 +- 11 files changed, 13 insertions(+), 14 deletions(-) diff --git a/core/apps/accounts/admin/user.py b/core/apps/accounts/admin/user.py index 68d8ebc..5aad30e 100644 --- a/core/apps/accounts/admin/user.py +++ b/core/apps/accounts/admin/user.py @@ -24,7 +24,7 @@ class UserAdmin(DjangoUserAdmin): }, ), ) - list_display = ("username", "phone_number", "full_name", "is_blocked", "is_staff") + list_display = ("id", "username", "phone_number", "full_name", "is_blocked", "is_staff") list_filter = ("is_staff", "is_superuser", "is_active", "is_blocked") search_fields = ("username", "full_name", "phone_number") ordering = ("username",) \ No newline at end of file diff --git a/core/apps/company/admin/branch.py b/core/apps/company/admin/branch.py index 94f3acb..3872da0 100644 --- a/core/apps/company/admin/branch.py +++ b/core/apps/company/admin/branch.py @@ -5,6 +5,6 @@ from core.apps.company.models import Branch @admin.register(Branch) class BranchAdmin(admin.ModelAdmin): - list_display = ['name', 'location', 'company'] + list_display = ['id', 'name', 'location', 'company'] search_fields = ['name', 'location', 'company'] list_filter = ['company'] \ No newline at end of file diff --git a/core/apps/company/admin/company.py b/core/apps/company/admin/company.py index b27ca0c..a8a4c69 100644 --- a/core/apps/company/admin/company.py +++ b/core/apps/company/admin/company.py @@ -4,5 +4,5 @@ from core.apps.company.models import Company @admin.register(Company) class CompanyAdmin(admin.ModelAdmin): - list_display = ['name'] + list_display = ['id', 'name'] search_fields = ['name'] \ No newline at end of file diff --git a/core/apps/orders/admin/party.py b/core/apps/orders/admin/party.py index 0f02f29..4fcee87 100644 --- a/core/apps/orders/admin/party.py +++ b/core/apps/orders/admin/party.py @@ -11,7 +11,7 @@ class PartyAmountInline(admin.StackedInline): @admin.register(Party) class PartyAdmin(admin.ModelAdmin): - list_display = ['number','mediator', 'delivery_date', 'payment_date', 'is_deleted'] + list_display = ['id','number','mediator', 'delivery_date', 'payment_date', 'is_deleted'] inlines = [PartyAmountInline] diff --git a/core/apps/products/admin/product.py b/core/apps/products/admin/product.py index dd97893..6005d33 100644 --- a/core/apps/products/admin/product.py +++ b/core/apps/products/admin/product.py @@ -5,5 +5,5 @@ from core.apps.products.models.product import Product @admin.register(Product) class ProductAdmin(admin.ModelAdmin): - list_display = ['name'] + list_display = ['id', 'name'] search_fields = ['name'] \ No newline at end of file diff --git a/core/apps/products/admin/unity.py b/core/apps/products/admin/unity.py index be7a78d..36c216e 100644 --- a/core/apps/products/admin/unity.py +++ b/core/apps/products/admin/unity.py @@ -5,5 +5,5 @@ from core.apps.products.models.unity import Unity @admin.register(Unity) class UnityAdmin(admin.ModelAdmin): - list_display = ['value'] + list_display = ['id','value'] search_fields = ['value'] \ No newline at end of file diff --git a/core/apps/projects/admin/project.py b/core/apps/projects/admin/project.py index 5857e9a..5c950cc 100644 --- a/core/apps/projects/admin/project.py +++ b/core/apps/projects/admin/project.py @@ -6,9 +6,8 @@ from core.apps.projects.models.project import Project, ProjectFolder, ProjectLoc @admin.register(Project) class ProjectAdmin(admin.ModelAdmin): - list_display = ['name', 'location', 'start_date', 'end_date'] + list_display = ['id','name', 'location', 'start_date', 'end_date'] search_fields = ['name'] - inlines = [] @admin.register(ProjectFolder) @@ -19,4 +18,4 @@ class ProjectFolderAdmin(admin.ModelAdmin): @admin.register(ProjectLocation) class ProjectLocation(admin.ModelAdmin): - list_display = ['address', 'latitude', 'longitude'] \ No newline at end of file + list_display = ['id','address', 'latitude', 'longitude'] \ No newline at end of file diff --git a/core/apps/shared/admin/region.py b/core/apps/shared/admin/region.py index 0212973..408e86f 100644 --- a/core/apps/shared/admin/region.py +++ b/core/apps/shared/admin/region.py @@ -12,12 +12,12 @@ class DistrictInline(admin.TabularInline): @admin.register(Region) class ReginAdmin(admin.ModelAdmin): - list_display = ['name'] + list_display = ['id', 'name'] search_fields = ['name'] inlines = [DistrictInline] @admin.register(District) class DistrictAdmin(admin.ModelAdmin): - list_display = ['name'] + list_display = ['id', 'name'] search_fields = ['name'] \ No newline at end of file diff --git a/core/apps/wherehouse/admin/invalid_product.py b/core/apps/wherehouse/admin/invalid_product.py index f2fc327..b9b104b 100644 --- a/core/apps/wherehouse/admin/invalid_product.py +++ b/core/apps/wherehouse/admin/invalid_product.py @@ -5,4 +5,4 @@ from core.apps.wherehouse.models import InvalidProduct @admin.register(InvalidProduct) class InvalidProductAdmin(admin.ModelAdmin): - list_display = ['inventory', 'project_folder', 'amount', 'status'] \ No newline at end of file + list_display = ['id', 'inventory', 'project_folder', 'amount', 'status'] \ No newline at end of file diff --git a/core/apps/wherehouse/admin/stock_movement.py b/core/apps/wherehouse/admin/stock_movement.py index ecce23c..9107eed 100644 --- a/core/apps/wherehouse/admin/stock_movement.py +++ b/core/apps/wherehouse/admin/stock_movement.py @@ -5,4 +5,4 @@ from core.apps.wherehouse.models.stock_movemend import StockMovemend @admin.register(StockMovemend) class StockMovemendAdmin(admin.ModelAdmin): - list_display = ['wherehouse_to', 'wherehouse_from', 'product', 'quantity', 'movemend_type'] \ No newline at end of file + list_display = ['id','wherehouse_to', 'wherehouse_from', 'product', 'quantity', 'movemend_type'] \ No newline at end of file diff --git a/core/apps/wherehouse/admin/wherehouse.py b/core/apps/wherehouse/admin/wherehouse.py index 502fc29..4da3a22 100644 --- a/core/apps/wherehouse/admin/wherehouse.py +++ b/core/apps/wherehouse/admin/wherehouse.py @@ -5,6 +5,6 @@ from core.apps.wherehouse.models.wherehouse import WhereHouse @admin.register(WhereHouse) class WhereHouseAdmin(admin.ModelAdmin): - list_display = ['name', 'address', 'branch'] + list_display = ['id','name', 'address', 'branch'] search_fields = ['name', 'address'] list_filter = ['branch'] \ No newline at end of file