From 69c2a10b6b9b91b1b617021a555c79caffb5363b Mon Sep 17 00:00:00 2001 From: Ilyas Date: Thu, 21 Apr 2016 17:57:22 +0500 Subject: [PATCH] [PORT] tour --- res_partner_mails_count/__openerp__.py | 2 +- .../src/js/res_partner_mails_count_tour.js | 28 ++++++------------- res_partner_mails_count/templates.xml | 7 +++++ res_partner_mails_count/tests/test_phantom.py | 3 +- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/res_partner_mails_count/__openerp__.py b/res_partner_mails_count/__openerp__.py index aadb5ca..5d39403 100644 --- a/res_partner_mails_count/__openerp__.py +++ b/res_partner_mails_count/__openerp__.py @@ -13,7 +13,7 @@ "currency": "EUR", "depends": [ - 'mail_archives' + 'mail_archives', 'web_tour_extra' , ], "external_dependencies": {"python": [], "bin": []}, diff --git a/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js b/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js index b64e84b..aa49159 100644 --- a/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js +++ b/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js @@ -1,9 +1,10 @@ -(function () { +odoo.define('res_partner_mails_count.mails_count_tour', function (require) { 'use strict'; + var Core = require('web.core'); + var Tour = require('web.Tour'); + var _t = Core._t; - var _t = openerp._t; - - openerp.Tour.register({ + Tour.register({ id: 'mails_count_tour', name: _t("Mails count Tour"), mode: 'test', @@ -22,25 +23,12 @@ }, { - waitNot: '.mails_to:visible', - title: _t("Send message from here"), - placement: 'left', - content: _t("Now you can see corresponding mails. You can send mail to this partner right from here. Press 'Send a mesage'."), - element: '.oe_mail_wall .oe_msg.oe_msg_composer_compact>div>.oe_compose_post', - }, - { - title: "New message", - placement: 'left', - content: _t("You can type message here."), - element: 'div.oe_msg_content>textarea.field_text', - }, - { - wait: '7000', - title: "That's it", + waitFor: '.o_channel_name.mail_archives:visible', + title: _t("That's it"), content: _t("Enjoy your day!

IT-Projects LLC team "), popover: { next: _t("Close Tutorial") }, }, ] }); -}()); +}); diff --git a/res_partner_mails_count/templates.xml b/res_partner_mails_count/templates.xml index 7cb5bc1..ae9d0e7 100644 --- a/res_partner_mails_count/templates.xml +++ b/res_partner_mails_count/templates.xml @@ -1,6 +1,13 @@ + res.partner.mails.count res.partner diff --git a/res_partner_mails_count/tests/test_phantom.py b/res_partner_mails_count/tests/test_phantom.py index 515d55b..47e980c 100644 --- a/res_partner_mails_count/tests/test_phantom.py +++ b/res_partner_mails_count/tests/test_phantom.py @@ -4,7 +4,8 @@ import openerp.tests @openerp.tests.common.post_install(True) class TestUi(openerp.tests.HttpCase): def test_01_res_partner_mails_to_count(self): - self.phantom_js('/', "openerp.Tour.run('mails_count_tour', 'test')", "openerp.Tour.tours.mails_count_tour", login="admin") + # self.phantom_js('/', "openerp.Tour.run('mails_count_tour', 'test')", "openerp.Tour.tours.mails_count_tour", login="admin") + self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('mails_count_tour', 'test')","odoo.__DEBUG__.services['web.Tour'].tours.mails_count_tour", login="admin") def test_02_res_partner_mails_from_count(self): # wait till page loaded and then click and wait again