settings.py
i added below codeOSCAR_ORDER_STATUS_PIPELINE = {
'Pending': ('Processing', 'Cancelled',),
'Processing': ('Shipped', 'Cancelled',),
'Shipped': ('Delivered', 'Return', 'Returned', 'Cancelled',),
'Returned': ('Return', 'Returned',),
'Delivered': (),
'Cancelled': (),
}
OSCAR_ORDER_STATUS_CASCADE = {
'Processing': 'In progress',
'Shipped': 'Shipped',
'Delivered': 'Delivered',
'Returned': 'Returned',
'Cancelled': 'Cancelled'
}
@csrf_exempt
def return_order(request):
# Return Order after Delivery
if request.is_ajax():
data = request.body.decode('utf-8')
try:
order = Order.objects.get(id=int(data))
EventHandler().handle_order_status_change(order=order, new_status='Return')
return HttpResponse(json.dumps({'status': 'True', 'msg': 'OK'}))
except Exception as e:
print(e)
return HttpResponse(json.dumps({'status': 'False', 'msg': 'Error'}))
'Return' is not a valid status for order 100213 (current status: 'Delivered')
'Delivered':
('Return',),
--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/a4186dd0-8ff1-4a66-9822-9cd5c4a15d35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.