From 69c6b2f4635c13ea09551e8305293b4cffca32db Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 2 Dec 2025 20:34:55 +0530 Subject: [PATCH] fix: do not override source document in serial no --- .../doctype/serial_and_batch_bundle/serial_and_batch_bundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):