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/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index 3c99fa3994..e5aa7e33d8 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -791,14 +791,7 @@ _f.Frm.prototype.runclientscript = function(caller, cdt, cdn) { validated = false; // show error message - 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(); + this.log_error(caller, e); } if(caller && caller.toLowerCase()=='setup') { this.setup_client_js(); @@ -815,8 +808,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); } } @@ -833,6 +826,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);