From 0eafcfd21b533714ce555bcbd7351b3637a82fbf Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 18 Mar 2025 16:28:31 +0530 Subject: [PATCH] fix: SABB validation for packed items --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 5 +++++ 1 file changed, 5 insertions(+) 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 aefa9b558d..570147bb44 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) -- GitLab