[fix] create new
This commit is contained in:
parent
35fd8d99f7
commit
daaf55f047
3 changed files with 3 additions and 2 deletions
|
|
@ -89,5 +89,5 @@ def get_default_value(df, defaults, user_permissions, parent_doc):
|
|||
elif df.fieldtype == "Time":
|
||||
return nowtime()
|
||||
|
||||
elif (df.fieldtype == "Select" and df.options and df.options != "[Select]"):
|
||||
elif (df.fieldtype == "Select" and df.options and df.options not in ("[Select]", "Loading...")):
|
||||
return df.options.split("\n")[0]
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class Document(BaseDocument):
|
|||
if not single_doc:
|
||||
single_doc = frappe.new_doc(self.doctype).as_dict()
|
||||
single_doc["name"] = self.doctype
|
||||
del single_doc["__islocal"]
|
||||
|
||||
self.update(single_doc)
|
||||
self.init_valid_columns()
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ $.extend(frappe.model, {
|
|||
doc[f.fieldname] = v;
|
||||
updated.push(f.fieldname);
|
||||
} else if(f.fieldtype == "Select" && f.options
|
||||
&& f.options!="[Select]") {
|
||||
&& !in_list(["[Select]", "Loading..."], f.options)) {
|
||||
doc[f.fieldname] = f.options.split("\n")[0];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue