From fbef1fdf3a3b490746ffcf2e15b2193f9f7f400d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Oct 2015 16:18:32 +0530 Subject: [PATCH] Minor fix --- erpnext/setup/doctype/naming_series/naming_series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index a1f48792e0..cdddf90f48 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -181,6 +181,9 @@ def get_default_naming_series(doctype): naming_series = frappe.get_meta(doctype).get_field("naming_series").options or "" naming_series = naming_series.split("\n") out = naming_series[0] or (naming_series[1] if len(naming_series) > 1 else None) - if out: + + if not out: frappe.throw(_("Please set Naming Series for {0} via Setup > Settings > Naming Series").format(doctype), NamingSeriesNotSetError) + else: + return out