From 95895277849a15d55120af5826a67441e1fa7eac Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 7 Jul 2017 15:34:28 +0530 Subject: [PATCH] Fixed the issue Serial No serial no not found --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 282425daa6..2dd4e7a733 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -803,9 +803,10 @@ class SalesInvoice(SellingController): continue for serial_no in item.serial_no.split("\n"): - sno = frappe.get_doc('Serial No', serial_no) - sno.sales_invoice = invoice - sno.db_update() + if serial_no and frappe.db.exists('Serial No', serial_no): + sno = frappe.get_doc('Serial No', serial_no) + sno.sales_invoice = invoice + sno.db_update() def validate_serial_numbers(self): """