Browse Source

Merge remote-tracking branch 'origin/8.0-res_partner_mails_count' into 9.0-res_partner_mails_count-merge

pull/6/head
Ivan Yelizariev 9 years ago
parent
commit
07aa093286
  1. 1
      res_partner_mails_count/__openerp__.py
  2. 13
      res_partner_mails_count/static/description/index.html
  3. 46
      res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js
  4. 14
      res_partner_mails_count/templates.xml
  5. 1
      res_partner_mails_count/tests/__init__.py
  6. 18
      res_partner_mails_count/tests/test_phantom.py

1
res_partner_mails_count/__openerp__.py

@ -14,6 +14,7 @@
"depends": [ "depends": [
'mail_archives' 'mail_archives'
'web_tour_extra' ,
], ],
"external_dependencies": {"python": [], "bin": []}, "external_dependencies": {"python": [], "bin": []},
"data": [ "data": [

13
res_partner_mails_count/static/description/index.html

@ -19,3 +19,16 @@
</div> </div>
</section> </section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:it@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:it@it-projects.info">it@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">
https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
</ul>
</div>
</div>
</section>

46
res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js

@ -0,0 +1,46 @@
(function () {
'use strict';
var _t = openerp._t;
openerp.Tour.register({
id: 'mails_count_tour',
name: _t("Mails count Tour"),
mode: 'test',
path: '/web?res_partner_mails_count=tutorial#id=3&view_type=form&model=res.partner',
// mode: 'tutorial',
steps: [
{
title: _t("Mails count tutorial"),
content: _t("Let's see how mails count work."),
popover: { next: _t("Start Tutorial"), end: _t("Skip") },
},
{
title: _t("New fields"),
content: _t("Here is new fields with mails counters. Press one of it."),
element: '.mails_to',
},
{
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 <em>'Send a mesage'</em>."),
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",
content: _t("Enjoy your day! <br/> <br/><a href='https://www.it-projects.info/apps' target='_blank'>IT-Projects LLC</a> team "),
popover: { next: _t("Close Tutorial") },
},
]
});
}());

14
res_partner_mails_count/templates.xml

@ -8,13 +8,13 @@
<field name="priority" eval="50"/> <field name="priority" eval="50"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<div name="button_box" position="inside"> <div name="button_box" position="inside">
<button class="oe_stat_button" type="action"
<button class="oe_stat_button mails_to" type="action"
name="%(action_mails)d" name="%(action_mails)d"
context="{'search_default_partner_ids': [active_id], 'default_model': 'res.partner', 'default_res_id': active_id}" context="{'search_default_partner_ids': [active_id], 'default_model': 'res.partner', 'default_res_id': active_id}"
icon="fa-envelope"> icon="fa-envelope">
<field string="Mails to" name="mails_to" widget="statinfo"/> <field string="Mails to" name="mails_to" widget="statinfo"/>
</button> </button>
<button class="oe_stat_button" type="action"
<button class="oe_stat_button mails_from" type="action"
name="%(action_mails)d" name="%(action_mails)d"
context="{'search_default_author_id': active_id, 'default_model': 'res.partner', 'default_res_id': active_id}" context="{'search_default_author_id': active_id, 'default_model': 'res.partner', 'default_res_id': active_id}"
icon="fa-envelope-o"> icon="fa-envelope-o">
@ -23,5 +23,15 @@
</div> </div>
</field> </field>
</record> </record>
<record id="res_partner_mails_count_tutorial" model="ir.actions.act_url">
<field name="name">res_partner_mails_count Tutorial</field>
<field name="url" eval="'/web?debug=1&amp;res_partner_mails_count=tutorial#id='+str(ref('base.partner_root'))+'&amp;view_type=form&amp;model=res.partner&amp;/#tutorial_extra.mails_count_tour=true'"/>
<field name="target">self</field>
</record>
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="res_partner_mails_count_tutorial"/>
<field name="state">open</field>
<field name="sequence">200</field>
</record>
</data> </data>
</openerp> </openerp>

1
res_partner_mails_count/tests/__init__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from . import test_mail from . import test_mail
from . import test_phantom

18
res_partner_mails_count/tests/test_phantom.py

@ -0,0 +1,18 @@
import openerp.tests
@openerp.tests.common.at_install(False)
@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")
def test_02_res_partner_mails_from_count(self):
# wait till page loaded and then click and wait again
code = """
setTimeout(function () {
$(".mails_from").click();
setTimeout(function () {console.log('ok');}, 3000);
}, 3000);
"""
link = '/web#id=3&view_type=form&model=res.partner'
self.phantom_js(link, code, "openerp.Tour.tours.mails_count_tour", login="admin")
Loading…
Cancel
Save