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 07bda8d80b004efe2810208e847982cd6419314a..628925db7716579698c233aff16ec2e392877771 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 @@ -126,6 +126,11 @@ class SerialandBatchBundle(Document): ) elif not frappe.db.exists("Stock Ledger Entry", {"voucher_detail_no": self.voucher_detail_no}): + if self.voucher_type == "Delivery Note" and frappe.db.exists( + "Packed Item", self.voucher_detail_no + ): + return + frappe.throw( _("The serial and batch bundle {0} not linked to {1} {2}").format( bold(self.name), self.voucher_type, bold(self.voucher_no)