diff --git a/frappe/custom/doctype/customize_form/customize_form.js b/frappe/custom/doctype/customize_form/customize_form.js
index 8b5c0a0ff7..85df087668 100644
--- a/frappe/custom/doctype/customize_form/customize_form.js
+++ b/frappe/custom/doctype/customize_form/customize_form.js
@@ -4,6 +4,9 @@
frappe.provide("frappe.customize_form");
frappe.ui.form.on("Customize Form", {
+ setup: function(frm) {
+ frm.get_docfield("fields").allow_bulk_edit = 1;
+ },
onload: function(frm) {
frappe.customize_form.add_fields_help(frm);
diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py
index c4821ee9bf..46c74118db 100644
--- a/frappe/custom/doctype/customize_form/customize_form.py
+++ b/frappe/custom/doctype/customize_form/customize_form.py
@@ -195,10 +195,11 @@ class CustomizeForm(Document):
def update_custom_fields(self):
for i, df in enumerate(self.get("fields")):
- if df.get("__islocal"):
- self.add_custom_field(df, i)
- else:
- self.update_in_custom_field(df, i)
+ if df.get("is_custom_field"):
+ if not frappe.db.exists('Custom Field', {'dt': self.doc_type, 'fieldname': df.fieldname}):
+ self.add_custom_field(df, i)
+ else:
+ self.update_in_custom_field(df, i)
self.delete_custom_fields()
@@ -209,8 +210,8 @@ class CustomizeForm(Document):
for property in docfield_properties:
d.set(property, df.get(property))
-
- if i!=0:
+
+ if i!=0:
d.insert_after = self.fields[i-1].fieldname
d.idx = i
@@ -221,6 +222,7 @@ class CustomizeForm(Document):
meta = frappe.get_meta(self.doc_type)
meta_df = meta.get("fields", {"fieldname": df.fieldname})
if not (meta_df and meta_df[0].get("is_custom_field")):
+ # not a custom field
return
custom_field = frappe.get_doc("Custom Field", meta_df[0].name)
diff --git a/frappe/public/js/frappe/form/grid.js b/frappe/public/js/frappe/form/grid.js
index f35b1ad7d9..f7a24d007d 100644
--- a/frappe/public/js/frappe/form/grid.js
+++ b/frappe/public/js/frappe/form/grid.js
@@ -460,6 +460,11 @@ frappe.ui.form.Grid = Class.extend({
if(df.fieldtype==="Date" && value) {
value = frappe.datetime.user_to_str(value);
}
+
+ if(df.fieldtype==="Int" || df.fieldtype==="Check") {
+ value = cint(value);
+ }
+
d[fieldnames[ci]] = value;
});
}
diff --git a/frappe/website/doctype/web_form/web_form.py b/frappe/website/doctype/web_form/web_form.py
index c50e83f5ed..4b06092830 100644
--- a/frappe/website/doctype/web_form/web_form.py
+++ b/frappe/website/doctype/web_form/web_form.py
@@ -36,6 +36,20 @@ class WebForm(WebsiteGenerator):
and self.is_standard and not frappe.conf.developer_mode):
frappe.throw(_("You need to be in developer mode to edit a Standard Web Form"))
+ self.validate_fields()
+
+ def validate_fields(self):
+ '''Validate all fields are present'''
+ from frappe.model import no_value_fields
+ missing = []
+ meta = frappe.get_meta(self.doc_type)
+ for df in self.web_form_fields:
+ if df.fieldname and (df.fieldtype not in no_value_fields and not meta.has_field(df.fieldname)):
+ missing.append(df.fieldname)
+
+ if missing:
+ frappe.throw(_('Following fields are missing:') + '
' + '
'.join(missing))
+
def reset_field_parent(self):
'''Convert link fields to select with names as options'''
for df in self.web_form_fields: