Skip to content

Commit

Permalink
fix: key error for stock ledger report (#41700)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored May 31, 2024
1 parent 07c4212 commit 4e37ed9
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 4e37ed9

Please sign in to comment.