瀏覽代碼

Merge pull request #3575 from tundebabzy/fix_docstring

[minor] corrects docstring for `set_new_name`
version-14
Makarand Bauskar 8 年之前
committed by GitHub
父節點
當前提交
55e266c865
共有 1 個檔案被更改,包括 8 行新增9 行删除
  1. +8
    -9
      frappe/model/naming.py

+ 8
- 9
frappe/model/naming.py 查看文件

@@ -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")



Loading…
取消
儲存