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 aefa9b558d8be97afc2cc9a17f1d2d81db93e590..570147bb449eb19c8c55348503c39f813323e981 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 @@ -145,6 +145,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)