Bläddra i källkod

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 år sedan
committed by GitHub
förälder
incheckning
86f3e45956
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 4AEE18F83AFDEB23
1 ändrade filer med 4 tillägg och 1 borttagningar
  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 Visa fil

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


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


counter = frappe.db.get_value(self.doctype, self.name, 'counter', for_update=True) or 0 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.db.set_value(self.doctype, self.name, 'counter', counter + 1)


@frappe.whitelist() @frappe.whitelist()


Laddar…
Avbryt
Spara