Просмотр исходного кода

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
Родитель
Сommit
86f3e45956
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 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()


Загрузка…
Отмена
Сохранить