Skip to content

Commit

Permalink
fix: Stock Entry - Error while selecting the batch number in the add …
Browse files Browse the repository at this point in the history
…serial Nos dialog in the stock entry child table
  • Loading branch information
vinod-8848digital committed Oct 22, 2024
1 parent 014d4d1 commit 7f2ff25
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions erpnext/controllers/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,13 @@ def get_batches_from_stock_ledger_entries(searchfields, txt, filters, start=0, p
& (batch_table.disabled == 0)
& (stock_ledger_entry.batch_no.isnotnull())
)
.groupby(stock_ledger_entry.batch_no, stock_ledger_entry.warehouse)
.groupby(
stock_ledger_entry.batch_no,
stock_ledger_entry.warehouse,
batch_table.manufacturing_date,
batch_table.expiry_date,
batch_table.name
)
.having(Sum(stock_ledger_entry.actual_qty) != 0)
.offset(start)
.limit(page_len)
Expand Down Expand Up @@ -481,7 +487,13 @@ def get_batches_from_serial_and_batch_bundle(searchfields, txt, filters, start=0
& (batch_table.disabled == 0)
& (stock_ledger_entry.serial_and_batch_bundle.isnotnull())
)
.groupby(bundle.batch_no, bundle.warehouse)
.groupby(
bundle.batch_no,
bundle.warehouse,
batch_table.manufacturing_date,
batch_table.expiry_date,
batch_table.name
)
.having(Sum(bundle.qty) != 0)
.offset(start)
.limit(page_len)
Expand Down

0 comments on commit 7f2ff25

Please sign in to comment.