This commit is contained in:
jeremygan2021
2026-02-10 23:35:53 +08:00
parent 6a025a7534
commit 0b3b81915b
24 changed files with 148 additions and 4 deletions

View File

@@ -77,13 +77,13 @@ class WeChatPayConfigAdmin(ModelAdmin):
@admin.register(ESP32Config)
class ESP32ConfigAdmin(ModelAdmin):
form = ESP32ConfigAdminForm
list_display = ('name', 'chip_type', 'price', 'has_camera', 'has_microphone')
list_display = ('name', 'chip_type', 'price', 'stock', 'has_camera', 'has_microphone')
list_filter = ('chip_type', 'has_camera')
search_fields = ('name', 'description')
inlines = [ProductFeatureInline]
fieldsets = (
('基本信息', {
'fields': ('name', 'price', 'description')
'fields': ('name', 'price', 'stock', 'description')
}),
('硬件参数', {
'fields': ('chip_type', 'flash_size', 'ram_size', 'has_camera', 'has_microphone')
@@ -209,7 +209,7 @@ class SalespersonAdmin(ModelAdmin):
@admin.register(Order)
class OrderAdmin(ModelAdmin):
list_display = ('id', 'customer_name', 'config', 'total_price', 'status', 'salesperson', 'created_at')
list_display = ('id', 'customer_name', 'config', 'total_price', 'status', 'courier_name', 'tracking_number', 'salesperson', 'created_at')
list_filter = ('status', 'salesperson', 'created_at')
search_fields = ('id', 'customer_name', 'phone_number', 'wechat_trade_no')
readonly_fields = ('total_price', 'created_at', 'wechat_trade_no')
@@ -221,6 +221,9 @@ class OrderAdmin(ModelAdmin):
('客户信息', {
'fields': ('customer_name', 'phone_number', 'shipping_address')
}),
('物流信息', {
'fields': ('courier_name', 'tracking_number')
}),
('销售归属', {
'fields': ('salesperson',)
}),