Minor fix

This commit is contained in:
Nabin Hait 2015-10-02 16:18:32 +05:30
parent 4358e1cd46
commit fbef1fdf3a

View File

@ -181,6 +181,9 @@ def get_default_naming_series(doctype):
naming_series = frappe.get_meta(doctype).get_field("naming_series").options or "" naming_series = frappe.get_meta(doctype).get_field("naming_series").options or ""
naming_series = naming_series.split("\n") naming_series = naming_series.split("\n")
out = naming_series[0] or (naming_series[1] if len(naming_series) > 1 else None) 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), frappe.throw(_("Please set Naming Series for {0} via Setup > Settings > Naming Series").format(doctype),
NamingSeriesNotSetError) NamingSeriesNotSetError)
else:
return out