fix: get_contact_list in Email dialog (#5623)

This commit is contained in:
Faris Ansari 2018-05-28 18:09:32 +05:30 committed by GitHub
parent 5ea4fb6157
commit c4e8482da0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,16 @@ frappe.views.CommunicationComposer = Class.extend({
}
});
frappe.call({
method: "frappe.email.get_contact_list",
callback: (r) => {
const contactList = r.message;
['recipients', 'cc', 'bcc'].forEach(field => {
this.dialog.fields_dict[field].set_data(contactList);
});
}
});
$(document).on("upload_complete", function(event, attachment) {
if(me.dialog.display) {
var wrapper = $(me.dialog.fields_dict.select_attachments.wrapper);
@ -47,13 +57,6 @@ frappe.views.CommunicationComposer = Class.extend({
get_fields: function() {
let contactList = [];
frappe.call({
method: "frappe.email.get_contact_list",
async: false,
callback: function(r) {
contactList = r.message;
}
});
var fields= [
{label:__("To"), fieldtype:"MultiSelect", reqd: 0, fieldname:"recipients",options:contactList},
{fieldtype: "Section Break", collapsible: 1, label: __("CC, BCC & Email Template")},