diff --git a/core/doctype/custom_field/custom_field.py b/core/doctype/custom_field/custom_field.py
index 5099123d4f..d7909de560 100644
--- a/core/doctype/custom_field/custom_field.py
+++ b/core/doctype/custom_field/custom_field.py
@@ -9,6 +9,10 @@ from webnotes.utils import cint, cstr
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
+
+ def autoname(self):
+ self.set_fieldname()
+ self.doc.name = self.doc.dt + "-" + self.doc.fieldname
def set_fieldname(self):
if not self.doc.fieldname:
@@ -104,7 +108,7 @@ def get_fields_label(dt=None, form=1):
field_list = [cstr(d.fieldname) for d in docfields]
return idx_label_list, field_list
-def delete_and_create_custom_field_if_values_exist(doctype, df):
+def create_custom_field_if_values_exist(doctype, df):
df = webnotes._dict(df)
if webnotes.conn.sql("""select count(*) from `tab{doctype}`
where ifnull({fieldname},'')!=''""".format(doctype=doctype, fieldname=df.fieldname))[0][0]:
diff --git a/core/doctype/custom_field/custom_field.txt b/core/doctype/custom_field/custom_field.txt
index 7600c7868e..e0831523dd 100644
--- a/core/doctype/custom_field/custom_field.txt
+++ b/core/doctype/custom_field/custom_field.txt
@@ -2,12 +2,11 @@
{
"creation": "2013-01-10 16:34:01",
"docstatus": 0,
- "modified": "2013-07-05 14:33:59",
+ "modified": "2013-11-05 20:07:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
- "autoname": "eval:doc.dt+\"-\"+doc.fieldname",
"description": "Adds a custom field to a DocType",
"doctype": "DocType",
"icon": "icon-glass",
diff --git a/core/doctype/doctype/doctype.txt b/core/doctype/doctype/doctype.txt
index 4063f13254..36628e253c 100644
--- a/core/doctype/doctype/doctype.txt
+++ b/core/doctype/doctype/doctype.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-18 13:36:19",
"docstatus": 0,
- "modified": "2013-11-02 23:01:10",
+ "modified": "2013-11-05 20:09:08",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -155,7 +155,7 @@
"fieldtype": "Section Break"
},
{
- "description": "\\\n
\ + \