From 8abc1f4da96c7d037c2a6bb55d655f9831dfbb41 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 19 Sep 2024 09:37:08 +0530 Subject: [PATCH] fix: Serial No reserved against historical sales order - unable to sell again (#43294) --- erpnext/stock/doctype/serial_no/serial_no.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 10d5ae643b0..25932a3ad04 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -404,7 +404,7 @@ def validate_serial_no(sle, item_det): ) # if Sales Order reference in Serial No validate the Delivery Note or Invoice is against the same - if sr.sales_order: + if sr.sales_order and sr.delivery_document_no: if sle.voucher_type == "Sales Invoice": if not frappe.db.exists( "Sales Invoice Item",