diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js
index 72e06e9..8336088 100644
--- a/mail_to/static/src/js/mail_to.js
+++ b/mail_to/static/src/js/mail_to.js
@@ -15,7 +15,7 @@ odoo.define('mail_to.MailTo', function (require) {
msg.partner_ids = data.partner_ids;
msg.channel_names = data.channel_names;
msg.channel_ids = data.channel_ids;
- msg.recipients = data.partner_ids.concat(data.channel_names);
+ msg.recipients = data.partner_ids.concat(data.channel_names ? data.channel_names : []);
if (!msg.partner_ids && !msg.channel_names) {
return msg;
}
diff --git a/mail_to/static/src/js/test_mail_to.js b/mail_to/static/src/js/test_mail_to.js
index ff20b9d..2a72ccd 100644
--- a/mail_to/static/src/js/test_mail_to.js
+++ b/mail_to/static/src/js/test_mail_to.js
@@ -7,13 +7,27 @@ odoo.define('mail_to.tour', function (require) {
var core = require('web.core');
var _t = core._t;
- var email = 'mail_private test email';
- var steps = [{
- trigger: 'a.recipient_link:first',
- content: _t("Open Partners Form From Recipient Link"),
- position: 'bottom',
- timeout: 70000,
- }];
+ var steps = [tour.STEPS.SHOW_APPS_MENU_ITEM, {
+ trigger: '.o_app[data-menu-xmlid="mail.menu_root_discuss"]',
+ content: _t('Want to get in touch with your contacts? Discuss with them here.'),
+ position: 'right',
+ edition: 'community',
+ },{
+ trigger: '.fa.fa-plus.o_add[data-type="public"]',
+ position: 'right',
+ edition: 'community',
+ run: function (actions) {
+ $('.o_input.ui-autocomplete-input').val("Channel #" + String(new Date().getTime()));
+ $('.o_input.ui-autocomplete-input').keydown();
+ setTimeout(function(){
+ $('.ui-menu-item > a').click();
+ }, 1000);
+ },
+ },{
+ trigger: 'a.recipient_link:first',
+ content: _t("Open Partners Form From Recipient Link"),
+ position: 'bottom',
+ }];
tour.register('mail_to_tour', { test: true, url: '/web' }, steps);
diff --git a/mail_to/templates.xml b/mail_to/templates.xml
index c847cea..3bbe48e 100644
--- a/mail_to/templates.xml
+++ b/mail_to/templates.xml
@@ -13,6 +13,7 @@
+
diff --git a/mail_to/tests/test_default.py b/mail_to/tests/test_default.py
index d0bf499..b25d4d1 100644
--- a/mail_to/tests/test_default.py
+++ b/mail_to/tests/test_default.py
@@ -41,16 +41,11 @@ class TestUi(odoo.tests.HttpCase):
env["mail.notification"].create(
{"res_partner_id": p, "mail_message_id": msg.id, "is_read": False}
)
- code = """
- setTimeout(function () {
- console.log($('a.recipient_link').length && 'ok' || 'error');
- }, 3000);
- """
link = "/web#%s" % url_encode({"action": "mail.action_discuss"})
self.phantom_js(
link,
- code,
- "odoo.__DEBUG__.services['web_tour.tour'].tours.mail_tour.ready",
+ "odoo.__DEBUG__.services['web_tour.tour'].run('mail_to_tour', 1000);",
+ "odoo.__DEBUG__.services['web_tour.tour'].tours.mail_to_tour.ready",
login="admin",
)