ソースを参照

Made seprate method to parse the naming series (#3293)

version-14
rohitwaghchaure 8年前
committed by Nabin Hait
コミット
0aa97b7aaa
1個のファイルの変更7行の追加3行の削除
  1. +7
    -3
      frappe/model/naming.py

+ 7
- 3
frappe/model/naming.py ファイルの表示

@@ -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=''):


読み込み中…
キャンセル
保存