You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hi I am working on a store using django oscar, and there is this issue that i am facing. Even after i change status to shipped or complete in dashboard, the num_in_stock never changes.I did dig into the source to find that processing.py in apps/order have a method consume_stock_allocations which in turn calls consume_allocation(quantity) over each line to update num_in_stock and num_allocated. But the catch is consume_stock_allocations is never called, thus, num_in_stock remains same and num_allocated keeps on increasing. I dont get it. Was it intentional ? or should i try to call this consume_stock_allocations when order status (from dashboard's OrderDetailView) is changed to shipping or from OrderListView ) when line status is made to change.Please help me out. Regards vijay
John P
unread,
Mar 25, 2015, 1:33:26 PM3/25/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I think the intention is that you're supposed to manually set num_in_stock and reset num_allocated to zero when you actually do a real count of how many items you have on hand.
David Winterbottom
unread,
Mar 25, 2015, 5:57:00 PM3/25/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-oscar
Placing an order will record the stock allocations, but you need to
call the "consume_stock_allocations" method as part of your order
processing. That method needs to be called when you actually ship
something, which happens in different ways in different shops.
To accomplish this you have to fork checkout app, define your own EventHandler that inherits from Oscar's one, override handle_shipping_event method and call consume_stock_allocations (which in turn is already in Oscar core).