fix: check if autoname is promt before setting __newname
This commit is contained in:
parent
a1bfdf28a2
commit
78cf0cd142
1 changed files with 4 additions and 1 deletions
|
|
@ -464,8 +464,11 @@ class Document(BaseDocument):
|
|||
if self.flags.name_set and not force:
|
||||
return
|
||||
|
||||
meta = self.meta or frappe.get_meta(self.doctype)
|
||||
autoname = meta.autoname or ""
|
||||
|
||||
# If autoname has set as Prompt (name)
|
||||
if self.get("__newname"):
|
||||
if self.get("__newname") and autoname == "Prompt":
|
||||
self.name = validate_name(self.doctype, self.get("__newname"))
|
||||
self.flags.name_set = True
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue