forked from erp-dev/erp
feat: fix admin
This commit is contained in:
@@ -467,29 +467,3 @@ class PrintingJobBatchAdvanceRecordAdmin(admin.ModelAdmin):
|
|||||||
@admin.display(description='涉及任务数')
|
@admin.display(description='涉及任务数')
|
||||||
def jobs_count(self, obj: models.PrintingJobBatchAdvanceRecord) -> int:
|
def jobs_count(self, obj: models.PrintingJobBatchAdvanceRecord) -> int:
|
||||||
return obj.printing_jobs.count()
|
return obj.printing_jobs.count()
|
||||||
|
|
||||||
|
|
||||||
@admin.register(models.PrintingJobBatchAdvanceRecord)
|
|
||||||
class PrintingJobBatchAdvanceRecordAdmin(admin.ModelAdmin):
|
|
||||||
list_display = (
|
|
||||||
'id',
|
|
||||||
'printing_order',
|
|
||||||
'state',
|
|
||||||
'created_by',
|
|
||||||
'jobs_count',
|
|
||||||
'created_at',
|
|
||||||
)
|
|
||||||
list_filter = (
|
|
||||||
'state',
|
|
||||||
'created_by',
|
|
||||||
'created_at',
|
|
||||||
)
|
|
||||||
search_fields = (
|
|
||||||
'printing_order__customer__name',
|
|
||||||
'state__name',
|
|
||||||
'created_by__username',
|
|
||||||
)
|
|
||||||
readonly_fields = (
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user