Each time an order is edited through the admin interface, even when no changes are made to the products, a message is added to the order log stating that the stock level has been decreased. If between edits, other orders are made, the order log will look like this:
2010/02/28 The stock level for DBRD10 has been decreased to 55.
2010/02/28 The stock level for DBRD10 has been decreased to 55.
2010/03/02 The stock level for DBRD10 has been decreased to 54.
2010/03/02 The stock level for DBRD10 has been decreased to 54.
It looks like stock has been decremented twice, plus some duplicate messages, while only the first one is relevant.
Comment | File | Size | Author |
---|---|---|---|
#1 | uc_order.admin_.inc_.732482.patch | 619 bytes | wimh |
Comments
Comment #1
wimh CreditAttribution: wimh commenteduc_stock_decrement_product_stock() is called for each product and for each order edit, with the change in quantity for this product as argument. So the stock quantity is always correct, we should just remove the message when the quantity did not change.
The attached patch does this: when $product->qty (defined as new quantity minus quantity before edit) equals zero, uc_stock_decrement_product_stock() is not called.
Comment #2
TR CreditAttribution: TR commentedDuplicate of #690740: Messages of "stock decrement" in admin comments with no stock changes (fix included). - please review the patch in that issue.