fix: SABB validation for packed items

(cherry picked from commit 3756bf231b)
This commit is contained in:
Rohit Waghchaure
2025-03-18 16:28:31 +05:30
committed by Mergify
parent a07eb556cf
commit 2d6626e906

View File

@@ -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)