diff --git a/frappe/model/naming.py b/frappe/model/naming.py index f38758ca9c..43c11da01d 100644 --- a/frappe/model/naming.py +++ b/frappe/model/naming.py @@ -129,7 +129,7 @@ def parse_naming_series(parts, doctype='', doc=''): if e.startswith('#'): if not series_set: digits = len(e) - part = getseries(n, digits, doctype) + part = getseries(n, digits) series_set = True elif e == 'YY': part = today.strftime('%y') @@ -152,7 +152,7 @@ def parse_naming_series(parts, doctype='', doc=''): return n -def getseries(key, digits, doctype=''): +def getseries(key, digits): # series created ? current = frappe.db.sql("SELECT `current` FROM `tabSeries` WHERE `name`=%s FOR UPDATE", (key,)) if current and current[0][0] is not None: diff --git a/frappe/tests/test_naming.py b/frappe/tests/test_naming.py index 1b1f0ac98c..90ab6a6a94 100644 --- a/frappe/tests/test_naming.py +++ b/frappe/tests/test_naming.py @@ -51,7 +51,7 @@ class TestNaming(unittest.TestCase): todo.description = description todo.insert() - series = getseries('', 2, doctype) + series = getseries('', 2) series = str(int(series)-1) @@ -93,4 +93,4 @@ class TestNaming(unittest.TestCase): count = frappe.db.sql("""SELECT current from `tabSeries` where name = %s""", series, as_dict=True)[0] self.assertEqual(count.get('current'), 2) - frappe.db.sql("""delete from `tabSeries` where name = %s""", series) \ No newline at end of file + frappe.db.sql("""delete from `tabSeries` where name = %s""", series)