Validate serial no after auto-creation based on naming series
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 14c409b..87c3caf 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -253,8 +253,9 @@
from frappe.model.naming import make_autoname
serial_nos = []
for i in xrange(cint(sle.actual_qty)):
- serial_nos.append(make_autoname(item_det.serial_no_series))
+ serial_nos.append(make_autoname(item_det.serial_no_series, "Serial No"))
frappe.db.set(sle, "serial_no", "\n".join(serial_nos))
+ validate_serial_no(sle, item_det)
if sle.serial_no:
serial_nos = get_serial_nos(sle.serial_no)