I was going through the code for the stock record model here, and above the num_allocated field it says in the comment,
#: The amount of stock allocated to orders but not fed back to the master
#: stock system. A typical stock update process will set the num_in_stock
#: variable to a new value and reset num_allocated to zero
So, how do I do the stock update process as specified in the comment when the product is out of stock?I need to set the num_in_stock variable to new value and set the num_allocated to zero.
So far if the order is being shipped, I call the consume_stock_allocations() method in the EventHandler Class and the num in stock for the products in the order is being reduced.
If someone has implemented this please do share some code or some example as I am new to oscar.