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 3e8df4dd8e5..46c3b180954 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 @@ -1301,7 +1301,7 @@ class SerialandBatchBundle(Document): sn_table.purchase_document_no, self.voucher_no if not sn_table.purchase_document_no else self.voucher_no, ) - .where(sn_table.name.isin(serial_nos)) + .where((sn_table.name.isin(serial_nos)) & (sn_table.purchase_document_no.isnull())) ).run() def validate_serial_and_batch_inventory(self):