【发布时间】:2018-09-05 09:58:53
【问题描述】:
我正在查看股票记录模型here 的代码,在评论中提到的 num_allocated 字段上方,
#: 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
那么,当产品缺货时,如何按照评论中的说明进行库存更新过程?我需要将 num_in_stock 变量设置为新值,并将 num_allocated 设置为零。
到目前为止,如果订单正在发货,我会调用 EventHandler 类中的 consume_stock_allocations() 方法,并且订单中产品的库存数量正在减少。
如果有人实现了这个,请分享一些代码或一些示例,因为我是 oscar 的新手。
【问题讨论】:
标签: django python-3.x django-oscar