Hello,

I wonder whether this bug http://www.ubercart.org/issue/6860/stock_isnt_decrease_adminstoreordersc..., being known since December, has been comitted to core updates? Just happened to me right now when I manually created a phone order. No decrease in stock. Have you confirmed that the proposed hack works?

Take care,
Annalina

Comments

cha0s’s picture

Assigned: Unassigned » cha0s
Priority: Critical » Normal
Status: Active » Needs review

Here, I tested this and it works. I also rewrote some of the way uc_stock works, so that in the case of an admin changing the stock here, threshold stuff will still work correctly. Test it and report back please. Thanks =)

cha0s’s picture

StatusFileSize
new4.99 KB
longwave’s picture

Any chance of adding a hook in uc_stock_adjust that passes the SKU, the old stock level and the adjustment? This would make my Stock Notify module simpler and more reliable, the current (D5) version has to hook into the stock edit form to detect when items come back into stock, and this still doesn't work if the stock levels are updated using another method.

rszrama’s picture

Issue tags: +ubercamp sprint
rszrama’s picture

Tagging.

cha0s’s picture

Assigned: cha0s » Unassigned
Island Usurper’s picture

Status: Needs review » Fixed
StatusFileSize
new7.18 KB

I found that changing a product's quantity on an order didn't affect the stock level either, so I added that and a new hook_uc_stock_adjusted() to the patch.

I will say I don't really like all of the if (module_exists()) in uc_order, but at this point it's not worth fixing. Maybe we can redesign it some for a later 2.x release.

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jasonabc’s picture

@ Island Usurper - a big bug IMHO has now been fixed - many thanks!! Quick question - does this also update attribute based stock levels?