fix: stock reco negative batch (backport #40533) (#40535)

fix: stock reco negative batch (#40533)

(cherry picked from commit a64c2ecf39)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-03-19 15:18:50 +05:30
committed by GitHub
parent 44bbf4b983
commit 7f1f7809c8
2 changed files with 7 additions and 1 deletions

View File

@@ -832,6 +832,13 @@ class SerialandBatchBundle(Document):
if not self.has_batch_no:
return
if (
self.voucher_type == "Stock Reconciliation"
and self.type_of_transaction == "Outward"
and frappe.db.get_value("Stock Reconciliation Item", self.voucher_detail_no, "qty") > 0
):
return
batches = [d.batch_no for d in self.entries if d.batch_no]
if not batches:
return

View File

@@ -154,7 +154,6 @@ class StockReconciliation(StockController):
{
"current_serial_and_batch_bundle": sn_doc.name,
"current_serial_no": "",
"batch_no": "",
}
)