[minor] naming series not set message

This commit is contained in:
Rushabh Mehta 2015-05-18 10:28:08 +05:30
parent 26c8a96b0a
commit 0718292bfa
2 changed files with 3 additions and 2 deletions

View File

@ -173,4 +173,6 @@ def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True
def get_default_naming_series(doctype):
naming_series = frappe.get_meta(doctype).get_field("naming_series").options or ""
naming_series = naming_series.split("\n")
return naming_series[0] or naming_series[1]
out = naming_series[0] or (naming_series[1] if len(naming_series) > 1 else None)
if out:
frappe.throw(_("Please set Naming Series for {0} via Setup > Settings > Naming Series").format(doctype))

View File

@ -37,7 +37,6 @@ class Issue(Document):
if values:
self.contact, self.customer = values
if not self.company:
self.company = frappe.db.get_value("Lead", self.lead, "company") or \
frappe.db.get_default("company")