diff --git a/core/doctype/customize_form/customize_form.js b/core/doctype/customize_form/customize_form.js index 0b011d12d8..fde24deedd 100644 --- a/core/doctype/customize_form/customize_form.js +++ b/core/doctype/customize_form/customize_form.js @@ -94,7 +94,7 @@ cur_frm.cscript.hide_allow_attach = function(doc, dt, dn) { 'Leave Application', 'Lead', 'Journal Voucher', 'Item', 'Material Request', 'Expense Claim', 'Opportunity', 'Employee', 'Delivery Note', 'Customer Issue', 'Customer', 'Contact Us Settings', 'Company', - 'Blog', 'BOM', 'About Us Settings']; + 'Blog', 'BOM', 'About Us Settings', 'Batch']; if(inList(allow_attach_list, doc.doc_type)) { unhide_field('allow_attach'); diff --git a/core/page/data_import_tool/data_import_tool.py b/core/page/data_import_tool/data_import_tool.py index ee5493b4db..879f4b40c0 100644 --- a/core/page/data_import_tool/data_import_tool.py +++ b/core/page/data_import_tool/data_import_tool.py @@ -129,7 +129,7 @@ def get_template(): webnotes.response['doctype'] = doctype def getdocfield(fieldname): - """get docfield from doclist of doctype""" + """get docfield from doclist of doctype""" l = [d for d in doctype_dl if d.doctype=='DocField' and d.fieldname==fieldname] return l and l[0] or None @@ -256,6 +256,10 @@ def check_record(d, parenttype): if parenttype and not d.get('parent'): raise Exception, "parent is required." + global doctype_dl + if not doctype_dl: + doctype_dl = webnotes.model.doctype.get(d.doctype) + for key in d: docfield = getdocfield(key) val = d[key] diff --git a/public/js/legacy/utils/datatype.js b/public/js/legacy/utils/datatype.js index db86bd5bd9..7f62f59495 100644 --- a/public/js/legacy/utils/datatype.js +++ b/public/js/legacy/utils/datatype.js @@ -107,7 +107,7 @@ function flt(v, decimals) { } // strip groups (,) - if(wn.number_format_info.group_sep==".") { + if(get_number_format_info(get_number_format()).group_sep==".") { v = v.replace(/\./g,''); // sanitize decimal separator to . diff --git a/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index a27f9e57a9..74fe6284a3 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -793,7 +793,9 @@ _f.Frm.prototype.runclientscript = function(caller, cdt, cdn) { } catch(e) { validated = false; - console.log(e); + + // show error message + this.log_error(caller, e); } if(caller && caller.toLowerCase()=='setup') { this.setup_client_js(); @@ -810,8 +812,8 @@ _f.Frm.prototype.setup_client_js = function(caller, cdt, cdn) { try { var tmp = eval(cs); } catch(e) { - show_alert("Error in Client Script.") - console.log(e); + show_alert("Error in Client Script."); + this.log_error(caller || "setup_client_js", e); } } @@ -828,6 +830,17 @@ _f.Frm.prototype.setup_client_js = function(caller, cdt, cdn) { } } +_f.Frm.prototype.log_error = function(caller, e) { + console.group && console.group(); + console.log("----- error in client script -----"); + console.log("method: " + caller); + console.log(e); + console.log("error message: " + e.message); + console.trace && console.trace(); + console.log("----- end of error message -----"); + console.group && console.groupEnd(); +} + _f.Frm.prototype.copy_doc = function(onload, from_amend) { if(!this.perm[0][CREATE]) { msgprint('You are not allowed to create '+this.meta.name); diff --git a/public/js/wn/app.js b/public/js/wn/app.js index ce3bcecf00..a0213d29c2 100644 --- a/public/js/wn/app.js +++ b/public/js/wn/app.js @@ -104,7 +104,7 @@ wn.Application = Class.extend({ }, make_page_container: function() { if($("#body_div").length) { - wn.temp_container = $("