18 lines
640 B
Python
18 lines
640 B
Python
from django.contrib import admin
|
|
from .models import Product, Order
|
|
|
|
|
|
@admin.register(Product)
|
|
class ProductAdmin(admin.ModelAdmin):
|
|
list_display = ['code', 'description', 'default_net_weight', 'created_at']
|
|
search_fields = ['code', 'description']
|
|
|
|
|
|
@admin.register(Order)
|
|
class OrderAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'product', 'batch_number', 'total_weight', 'canister_count',
|
|
'box_count', 'status', 'created_at']
|
|
list_filter = ['status', 'product']
|
|
search_fields = ['batch_number', 'product__code']
|
|
readonly_fields = ['canister_count', 'box_count', 'canister_pages', 'box_pages']
|