Django Oscar - Order Status - Part 17

Documentation: https://django-oscar.readthedocs.io/en/latest/ref/settings.html#order-settings

 

There are three different approaches to Order Status:

  • Order Status - Modifies the whole status of the order
  • Line Status - Modifies the status of specific products inside an order
  • Cascade -  Propagates the status of the Order into the status of each product

 


Order Status

OSCAR_INITIAL_ORDER_STATUS = 'Pending'

OSCAR_ORDER_STATUS_PIPELINE = {
    'Pending': ('Being processed', 'Cancelled'),
    'Being processed': ('Shipped', 'Cancelled'),
    'Shipped': ('Delivered', 'Cancelled'),
    'Delivered': (),
    'Cancelled': (),
}

 


Line Status

OSCAR_INITIAL_LINE_STATUS = 'Pending'

OSCAR_LINE_STATUS_PIPELINE = {
    'Pending': ('In progress', 'Cancelled',),
    'In progress': ('Shipped', 'Cancelled',),
    'Shipped': ('Received',),
    'Received': (),
    'Cancelled': (),
}

 


Cascade

OSCAR_ORDER_STATUS_CASCADE = {
    'Being processed': 'In progress',  
    'Shipped': 'Shipped',              
    'Delivered': 'Received',           
}