Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Improve order admin

Michal Ociepka5abd4c24b175
diff --git a/order/admin.py b/order/admin.py
index 9ae3fc2d33..d1d4bc631b 100644
--- a/order/admin.py
+++ b/order/admin.py
@@ -1,15 +1,27 @@
from django.contrib import admin
-from .models import Order
+from .models import Order, OrderedItem, DeliveryGroup
from payment.models import Payment
class PaymentInlineAdmin(admin.TabularInline):
model = Payment
+ extra = 0
+ readonly_fields = ['variant', 'status', 'transaction_id', 'currency',
+ 'total', 'delivery', 'description', 'first_name', 'tax',
+ 'last_name', 'city', 'country_area', 'zip', 'country']
+ exclude = ['token', 'extra_data', 'success_url', 'cancel_url']
+
+
+class DeliveryInlineAdmin(admin.TabularInline):
+
+ model = DeliveryGroup
class OrderAdmin(admin.ModelAdmin):
- inlines = [PaymentInlineAdmin]
+ inlines = [PaymentInlineAdmin, DeliveryInlineAdmin]
+ exclude = ['token']
+ readonly_fields = ['user', 'billing_address']
admin.site.register(Order, OrderAdmin)