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
This commit is contained in:
commit
86f3e45956
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue