Parcourir la source

[minor] corrects docstring for `set_new_name`

version-14
tunde il y a 8 ans
Parent
révision
8c9249b629
1 fichiers modifiés avec 8 ajouts et 9 suppressions
  1. +8
    -9
      frappe/model/naming.py

+ 8
- 9
frappe/model/naming.py Voir le fichier

@@ -8,17 +8,16 @@ from frappe.utils import now_datetime, cint
import re

def set_new_name(doc):
"""Sets the `name`` property for the document based on various rules.

1. If amened doc, set suffix.
3. If `autoname` method is declared, then call it.
4. If `autoname` property is set in the DocType (`meta`), then build it using the `autoname` property.
2. If `name` is already defined, use that name
5. If no rule defined, use hash.
"""
Sets the `name` property for the document based on various rules.

#### Note:
1. If amended doc, set suffix.
2. If `autoname` method is declared, then call it.
3. If `autoname` property is set in the DocType (`meta`), then build it using the `autoname` property.
4. If no rule defined, use hash.

:param doc: Document to be named."""
:param doc: Document to be named.
"""

doc.run_method("before_naming")



Chargement…
Annuler
Enregistrer