fix: batch selection issue (backport #41692) (#41693)

fix: batch selection issue (#41692)

(cherry picked from commit 968120d0eb)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-05-30 18:49:12 +05:30
committed by GitHub
parent 1a24914aed
commit 24775db97e
4 changed files with 24 additions and 1 deletions

View File

@@ -422,6 +422,7 @@ def get_batches_from_stock_ledger_entries(searchfields, txt, filters, start=0, p
& (stock_ledger_entry.batch_no.isnotnull())
)
.groupby(stock_ledger_entry.batch_no, stock_ledger_entry.warehouse)
.having(Sum(stock_ledger_entry.actual_qty) > 0)
.offset(start)
.limit(page_len)
)
@@ -472,6 +473,7 @@ def get_batches_from_serial_and_batch_bundle(searchfields, txt, filters, start=0
& (stock_ledger_entry.serial_and_batch_bundle.isnotnull())
)
.groupby(bundle.batch_no, bundle.warehouse)
.having(Sum(bundle.qty) > 0)
.offset(start)
.limit(page_len)
)