Bladeren bron

Merge pull request #3575 from tundebabzy/fix_docstring

[minor] corrects docstring for `set_new_name`
version-14
Makarand Bauskar 8 jaren geleden
committed by GitHub
bovenliggende
commit
55e266c865
1 gewijzigde bestanden met toevoegingen van 8 en 9 verwijderingen
  1. +8
    -9
      frappe/model/naming.py

+ 8
- 9
frappe/model/naming.py Bestand weergeven

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


def set_new_name(doc): 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") doc.run_method("before_naming")




Laden…
Annuleren
Opslaan