fix adpin.py and views.py order variables
This commit is contained in:
parent
1478768bfb
commit
6bba69f38c
Binary file not shown.
Binary file not shown.
@ -40,10 +40,10 @@ class OrderAdmin(admin.ModelAdmin):
|
||||
return "\n".join([str(p) for p in obj.order_products.all()])
|
||||
|
||||
def get_customer_name(self, obj):
|
||||
return obj.customer.name
|
||||
return obj.customer_name
|
||||
|
||||
def get_customer_telephone(self, obj):
|
||||
return obj.customer.telephone
|
||||
return obj.customer_telephone
|
||||
|
||||
get_customer_name.admin_order_field = 'customer_name' # Allows column order sorting
|
||||
get_customer_name.short_description = 'Customer Name' # Renames column head
|
||||
|
@ -80,8 +80,8 @@ class ExportView(View):
|
||||
writer.writerow([order.id, timezone.localtime(order.order_date).strftime("%d/%m/%Y %H:%M"),
|
||||
order.delivery_date.strftime("%d/%m/%Y"), order.store,
|
||||
prod.product.name, prod.amount, prod_specs,
|
||||
prod.info, order.customer.name, order.customer.telephone,
|
||||
order.customer.email, order.customer.social_media,
|
||||
prod.info, order.customer_name, order.customer_telephone,
|
||||
order.customer_email, order.customer_social_media,
|
||||
order.order_info])
|
||||
|
||||
return response
|
||||
|
Loading…
x
Reference in New Issue
Block a user