Stock Reconcilation making qty_after_transaction and stock_value to 0

Hi, We have a scanrio in which products are batch wise with proper serials as given by vendor. Now unfortunately, we have mistyped all serials (10), let say by 2 characters.

Now, we wanted to update them to actual serial numbers.

We are using Stock Reconcilation for this and when we submit the document and look into ledger it show qty_after_transaction and stock_value as 0.

For refernce image is attached.

Now attaching stock ledger

If we analyze, stock reconcilation has generated 2 entries, In entry 1 it has reduced the stock to 0 and in 2nd stock reconcilation entry it has taken the stock but the qty_after_transaction and stock_value both are showing as zero.

Anyone ?

I know this is an old thread, but the exact same thing happens to me. Is there anyone who knows if this bug is actually fixed?

I’m on ERPNext 12.18.0

I fixed this by changing values from DB, its was tiring though.

Hmm that’s not ideal, I feel your pain.

Our team found a possible fix in However not sure what was the original intention of this code on line 362. Until I’m sure of this logic I’m reluctant to try to do a pull request as I don’t want to create more bugs elsewhere.


It seems qty_after_transaction is only updated if there is not batch_no.

I can probably attempt to do a custom hook for before submit to update this, but again not sure of the original intention.

Anyone know what why this logic is here?