def set_name_by_naming_series(doc):
 if (not doc.naming_series):
  doc.naming_series = get_default_naming_series(doc.doctype)
 if (not doc.naming_series):
  frappe.throw(frappe._(u'Naming Series mandatory'))
 doc.name = make_autoname((doc.naming_series + u'.#####'), u'', doc)

def set_name_by_naming_series ( doc ) : if ( not doc . naming_series ) : doc . naming_series = get_default_naming_series ( doc . doctype ) if ( not doc . naming_series ) : frappe . throw ( frappe . _ ( u'Naming Series mandatory' ) ) doc . name = make_autoname ( ( doc . naming_series + u'.#####' ) , u'' , doc )
sets name by the naming_series property .