Browse Source

fix: backwards compatibility

version-14
hasnain2808@gmail.com 4 years ago
parent
commit
e95f7d201a
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      frappe/model/naming.py
  2. +1
    -1
      frappe/tests/test_document.py

+ 1
- 1
frappe/model/naming.py View File

@@ -198,7 +198,7 @@ def getseries(key, digits):
return ('%0'+str(digits)+'d') % current


def revert_series_if_last(key, name, doc):
def revert_series_if_last(key, name, doc=None):
if ".#" in key:
prefix, hashes = key.rsplit(".", 1)
if "#" not in hashes:


+ 1
- 1
frappe/tests/test_document.py View File

@@ -244,7 +244,7 @@ class TestDocument(unittest.TestCase):
prefix = parse_naming_series(prefix)
old_current = frappe.db.get_value('Series', prefix, "current", order_by="name")

revert_series_if_last(series, name, doc)
revert_series_if_last(series, name)
new_current = cint(frappe.db.get_value('Series', prefix, "current", order_by="name"))

self.assertEqual(cint(old_current) - 1, new_current)


Loading…
Cancel
Save