|
|
@@ -94,12 +94,15 @@ def make_autoname(key='', doctype='', doc=''): |
|
|
|
elif not "." in key: |
|
|
|
frappe.throw(_("Invalid naming series (. missing)") + (_(" for {0}").format(doctype) if doctype else "")) |
|
|
|
|
|
|
|
parts = key.split('.') |
|
|
|
n = parse_naming_series(parts, doctype, doc) |
|
|
|
return n |
|
|
|
|
|
|
|
def parse_naming_series(parts, doctype= '', doc = ''): |
|
|
|
n = '' |
|
|
|
l = key.split('.') |
|
|
|
series_set = False |
|
|
|
today = now_datetime() |
|
|
|
|
|
|
|
for e in l: |
|
|
|
for e in parts: |
|
|
|
part = '' |
|
|
|
if e.startswith('#'): |
|
|
|
if not series_set: |
|
|
@@ -120,6 +123,7 @@ def make_autoname(key='', doctype='', doc=''): |
|
|
|
|
|
|
|
if isinstance(part, basestring): |
|
|
|
n+=part |
|
|
|
|
|
|
|
return n |
|
|
|
|
|
|
|
def getseries(key, digits, doctype=''): |
|
|
|