@@ -96,9 +96,9 @@ def get_build_maps(): | |||||
source_paths.append(s) | source_paths.append(s) | ||||
build_maps[target] = source_paths | build_maps[target] = source_paths | ||||
except Exception: | |||||
except ValueError, e: | |||||
print path | print path | ||||
raise | |||||
print 'JSON syntax error {0}'.format(str(e)) | |||||
return build_maps | return build_maps | ||||
@@ -165,6 +165,8 @@ def get_js(src): | |||||
with open(contentpath, "r") as srcfile: | with open(contentpath, "r") as srcfile: | ||||
code = frappe.utils.cstr(srcfile.read()) | code = frappe.utils.cstr(srcfile.read()) | ||||
print code | |||||
if frappe.local.lang != "en": | if frappe.local.lang != "en": | ||||
messages = frappe.get_lang_dict("jsfile", contentpath) | messages = frappe.get_lang_dict("jsfile", contentpath) | ||||
messages = json.dumps(messages) | messages = json.dumps(messages) | ||||
@@ -103,9 +103,15 @@ frappe.ui.form.Control = Class.extend({ | |||||
}, | }, | ||||
get_parsed_value: function() { | get_parsed_value: function() { | ||||
var me = this; | var me = this; | ||||
return this.get_value ? | |||||
(this.parse ? this.parse(this.get_value()) : this.get_value()) : | |||||
undefined; | |||||
if(this.get_status()==='Write') { | |||||
return this.get_value ? | |||||
(this.parse ? this.parse(this.get_value()) : this.get_value()) : | |||||
undefined; | |||||
} else if(this.get_status()==='Read') { | |||||
return this.value || undefined; | |||||
} else { | |||||
return undefined; | |||||
} | |||||
}, | }, | ||||
set_model_value: function(value) { | set_model_value: function(value) { | ||||
if(this.frm) { | if(this.frm) { | ||||
@@ -411,7 +417,7 @@ frappe.ui.form.ControlData = frappe.ui.form.ControlInput.extend({ | |||||
this.set_mandatory && this.set_mandatory(value); | this.set_mandatory && this.set_mandatory(value); | ||||
}, | }, | ||||
get_value: function() { | get_value: function() { | ||||
return this.$input && this.$input.val() || this.value; | |||||
return this.$input ? this.$input.val() : undefined; | |||||
}, | }, | ||||
format_for_input: function(val) { | format_for_input: function(val) { | ||||
return val==null ? "" : val; | return val==null ? "" : val; | ||||
@@ -39,7 +39,6 @@ frappe.ui.form.Layout = Class.extend({ | |||||
// wrap in a block | // wrap in a block | ||||
html = '<div>' + html + '</div>'; | html = '<div>' + html + '</div>'; | ||||
} | } | ||||
console.log(html); | |||||
$(html).appendTo(this.message.removeClass('hidden')); | $(html).appendTo(this.message.removeClass('hidden')); | ||||
} else { | } else { | ||||
this.message.empty().addClass('hidden'); | this.message.empty().addClass('hidden'); | ||||