Revert "Merge pull request #32327 from akhilnarang/allow-passing-name-in-api"
This reverts commit1e30db26dc, reversing changes made to8da72e91e3.
This commit is contained in:
parent
274708b544
commit
ad948c9b98
3 changed files with 1 additions and 5 deletions
|
|
@ -39,8 +39,6 @@ def handle_rpc_call(method: str):
|
|||
def create_doc(doctype: str):
|
||||
data = get_request_form_data()
|
||||
data.pop("doctype", None)
|
||||
if (name := data.get("name")) and isinstance(name, str):
|
||||
frappe.flags.api_name_set = True
|
||||
return frappe.new_doc(doctype, **data).insert()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -171,8 +171,6 @@ def count(doctype: str) -> int:
|
|||
def create_doc(doctype: str):
|
||||
data = frappe.form_dict
|
||||
data.pop("doctype", None)
|
||||
if (name := data.get("name")) and isinstance(name, str):
|
||||
frappe.flags.api_name_set = True
|
||||
return frappe.new_doc(doctype, **data).insert().as_dict()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -646,7 +646,7 @@ class Document(BaseDocument):
|
|||
def set_new_name(self, force=False, set_name=None, set_child_names=True):
|
||||
"""Calls `frappe.naming.set_new_name` for parent and child docs."""
|
||||
|
||||
if (frappe.flags.api_name_set or self.flags.name_set) and not force:
|
||||
if self.flags.name_set and not force:
|
||||
return
|
||||
|
||||
autoname = self.meta.autoname or ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue