change party command
This commit is contained in:
@@ -5,4 +5,14 @@ from core.apps.orders.models import Order
|
||||
|
||||
@admin.register(Order)
|
||||
class OrderAdmin(admin.ModelAdmin):
|
||||
list_display = ['id', 'product', 'wherehouse', 'currency']
|
||||
list_display = ['id', 'product', 'wherehouse', 'currency', 'counterparty']
|
||||
|
||||
# # Statuslar: {'ORDERED', 'PARTIALLY_RECIEVED', 'pending', "open", "buying", "rejected", "recieved", "passive"}
|
||||
# open -> yangi == NEW
|
||||
# ordered -> partiya qilingan == PARTY_IS_MADE
|
||||
# pending -> kutilmoqda == EXPECTED
|
||||
# passive -> qoralama == DRAFT
|
||||
# recieved -> yopilgan == RECIEVED
|
||||
# rejected -> bekor qilingan == CANCELLED
|
||||
# buying -> sotib olinmoqda == PURCHASED
|
||||
# partially_recieved -> jarayonda == PROCESS
|
||||
@@ -1,6 +1,6 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from core.apps.orders.models import Party, PartyAmount, DeletedParty
|
||||
from core.apps.orders.models import DeletedParty, Party, PartyAmount
|
||||
|
||||
|
||||
class PartyAmountInline(admin.StackedInline):
|
||||
@@ -11,17 +11,28 @@ class PartyAmountInline(admin.StackedInline):
|
||||
|
||||
@admin.register(Party)
|
||||
class PartyAdmin(admin.ModelAdmin):
|
||||
list_display = ['id','number','mediator', 'delivery_date', 'payment_date', 'is_deleted']
|
||||
inlines = [PartyAmountInline]
|
||||
list_display = [
|
||||
"id",
|
||||
"number",
|
||||
"mediator",
|
||||
"delivery_date",
|
||||
"payment_date",
|
||||
"is_deleted",
|
||||
]
|
||||
inlines = [PartyAmountInline]
|
||||
search_fields = [
|
||||
"number",
|
||||
]
|
||||
|
||||
|
||||
@admin.register(PartyAmount)
|
||||
class PartyAmountAdmin(admin.ModelAdmin):
|
||||
list_display = ['id', 'total_price', 'cost_amount']
|
||||
list_display = ["id", "total_price", "cost_amount"]
|
||||
|
||||
def has_module_permission(self, request):
|
||||
return False
|
||||
|
||||
|
||||
@admin.register(DeletedParty)
|
||||
class DeletedPartyAdmin(admin.ModelAdmin):
|
||||
list_display = ['id', 'deleted_date', 'party']
|
||||
list_display = ["id", "deleted_date", "party"]
|
||||
|
||||
Reference in New Issue
Block a user