瀏覽代碼

Merge pull request #15634 from rohitwaghchaure/date-format-not-working-for-document-naming-rule

fix: the YYYY.MM.DD format not working for the document naming rule
version-14
mergify[bot] 3 年之前
committed by GitHub
父節點
當前提交
86f3e45956
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      frappe/core/doctype/document_naming_rule/document_naming_rule.py

+ 4
- 1
frappe/core/doctype/document_naming_rule/document_naming_rule.py 查看文件

@@ -5,6 +5,7 @@
import frappe
from frappe.model.document import Document
from frappe.utils.data import evaluate_filters
from frappe.model.naming import parse_naming_series
from frappe import _

class DocumentNamingRule(Document):
@@ -27,7 +28,9 @@ class DocumentNamingRule(Document):
return

counter = frappe.db.get_value(self.doctype, self.name, 'counter', for_update=True) or 0
doc.name = self.prefix + ('%0'+str(self.prefix_digits)+'d') % (counter + 1)
naming_series = parse_naming_series(self.prefix, doc=doc)

doc.name = naming_series + ('%0'+str(self.prefix_digits)+'d') % (counter + 1)
frappe.db.set_value(self.doctype, self.name, 'counter', counter + 1)

@frappe.whitelist()


Loading…
取消
儲存