diff --git a/core/doctype/communication/communication.js b/core/doctype/communication/communication.js index 3ba182e604..640b2ad902 100644 --- a/core/doctype/communication/communication.js +++ b/core/doctype/communication/communication.js @@ -17,6 +17,9 @@ cur_frm.cscript.onload = function(doc) { cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query; cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query; + + if(doc.content) + doc.content = wn.utils.escape_script_and_style(doc.content); } cur_frm.cscript.refresh = function(doc, dt, dn) { @@ -29,8 +32,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { }); if(hide_list.length < field_list.length) hide_field(hide_list); - - doc.content = wn.utils.escape_script_and_style(doc.content); } } diff --git a/public/js/wn/views/communication.js b/public/js/wn/views/communication.js index 1142765d51..e5f97f3f25 100644 --- a/public/js/wn/views/communication.js +++ b/public/js/wn/views/communication.js @@ -228,13 +228,13 @@ wn.views.CommunicationComposer = Class.extend({ return $(element).attr("data-file-name"); }) - // if(form_values.attach_document_print) { + if(form_values.attach_document_print) { _p.build(form_values.select_print_format || "", function(print_format_html) { me.send_email(btn, form_values, selected_attachments, print_format_html); }); - // } else { - // me.send_email(btn, form_values, selected_attachments); - // } + } else { + me.send_email(btn, form_values, selected_attachments); + } }); },