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 1fb4969e306..58971e8f19d 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 @@ 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 diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 3356ad5f300..0311481b6ca 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -154,7 +154,6 @@ class StockReconciliation(StockController): { "current_serial_and_batch_bundle": sn_doc.name, "current_serial_no": "", - "batch_no": "", } )