Skip to content

Commit

Permalink
fix: key error for stock ledger report (backport #41700) (#41703)
Browse files Browse the repository at this point in the history
fix: key error for stock ledger report (#41700)

(cherry picked from commit 4e37ed9)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure committed May 31, 2024
1 parent 4e9faf6 commit b22d714
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erpnext/stock/report/stock_ledger/stock_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ def execute(filters=None):
if filters.get("batch_no") or inventory_dimension_filters_applied:
actual_qty += flt(sle.actual_qty, precision)
stock_value += sle.stock_value_difference
batch_balance_dict[sle.batch_no] += sle.actual_qty
if sle.batch_no:
if not batch_balance_dict.get(sle.batch_no):
batch_balance_dict[sle.batch_no] = 0

batch_balance_dict[sle.batch_no] += sle.actual_qty

if filters.get("segregate_serial_batch_bundle"):
actual_qty = batch_balance_dict[sle.batch_no]

Expand Down

0 comments on commit b22d714

Please sign in to comment.