commit | a64c2ecf396a009bfcaa1e58ad34c61d1b671fe6 | [log] [tgz] |
---|---|---|
author | rohitwaghchaure <rohitw1991@gmail.com> | Tue Mar 19 14:54:17 2024 +0530 |
committer | GitHub <noreply@github.com> | Tue Mar 19 14:54:17 2024 +0530 |
tree | e508b80f72d1483f73c8d66b693ec632b9077df6 | |
parent | 5a8004bc58833351026f680316a8ecfe5832bbdb [diff] |
fix: stock reco negative batch (#40533)
diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index 1fb4969..58971e8 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py
@@ -832,6 +832,13 @@ 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
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 3356ad5..0311481 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -154,7 +154,6 @@ { "current_serial_and_batch_bundle": sn_doc.name, "current_serial_no": "", - "batch_no": "", } )