Fixed Incorrect Valuation Rate for Negative Stock

Hi everyone!

We noticed that the valuation rate doesn’t compute correctly when using perpetual inventory - moving average, and the item has a negative stock.

A lot of the suggestions provided in this forum was to disable negative stock, but that isn’t feasible for some scenarios where users need to create transactions quickly prior to having the stock for it. Examples: 1, 2, 3.

I think we were able to fix this for our users by adding additional conditions to handle negative quantities when computing the stock value and stock value difference. If there’s a need for it, we could create a pull request to the ERPNext core so everyone could benefit from this.

But we’d like to know, why hasn’t this been fixed? This seems like a huge issue to ignore. How did other people get around this?


Hi Kchan,

I have experienced the same issue, the workaround I used is to create artficial stock entry to prevent it goes to a negative stock. So it would be great if you could create a pull request and posted on here with a link. I’d like to fix this issue so that I don’t have to create fake stock entry anymore.

Thank you.