Browse Source

Merge pull request #45 from x620/mail-addons-9.0-res_partner_mails_count

Mail addons 9.0 res_partner_mails_count
pull/6/head
Ivan Yelizariev 9 years ago
parent
commit
2e716bbdb3
  1. 3
      mail_base/README.rst
  2. 22
      mail_base/static/src/js/base.js
  3. 7
      res_partner_mails_count/__openerp__.py
  4. 10
      res_partner_mails_count/static/src/js/main.js
  5. 9
      res_partner_mails_count/templates.xml
  6. 2
      res_partner_mails_count/views/res_partner_mails_count.xml

3
mail_base/README.rst

@ -1,7 +1,8 @@
Mail Base
=========
Modules doesn't introduce new features, but make built-in mail js features extendable.
* makes built-in mail js features extendable.
* handle ``search_default_*`` parameters in context.
Usage
-----

22
mail_base/static/src/js/base.js

@ -60,6 +60,28 @@ var channel_seen = _.throttle(function (channel) {
return ChannelModel.call('channel_seen', [[channel.id]], {}, {shadow: true});
}, 3000);
var ChatAction = core.action_registry.get('mail.chat.instant_messaging');
ChatAction.include({
start: function() {
var result = this._super.apply(this, arguments);
var search_defaults = {};
var context = this.action ? this.action.context : [];
_.each(context, function (value, key) {
var match = /^search_default_(.*)$/.exec(key);
if (match) {
search_defaults[match[1]] = value;
}
});
this.searchview.defaults = search_defaults;
var self = this;
return $.when(result).done(function() {
self.searchview.do_search();
});
}
});
var MailTools = core.Class.extend({
send_native_notification: function (title, content) {

7
res_partner_mails_count/__openerp__.py

@ -6,15 +6,14 @@
"images": ['images/1.png'],
"version": "1.0.0",
"author": "IT-Projects LLC",
"author": "IT-Projects LLC, Pavel Romanchenko",
"website": "https://it-projects.info",
"license": "GPL-3",
"license": "LGPL-3",
"price": 30.00,
"currency": "EUR",
"depends": [
'base',
'mail',
'mail_archives'
],
"external_dependencies": {"python": [], "bin": []},
"data": [

10
res_partner_mails_count/static/src/js/main.js

@ -1,10 +0,0 @@
// openerp.res_partner_mails_count = function(instance){
// instance.mail.Wall.include({
// init: function(){
// this._super.apply(this, arguments);
// if(this.context.ignore_search_model){
// delete this.defaults.model;
// }
// }
// });
// };

9
res_partner_mails_count/templates.xml

@ -1,15 +1,6 @@
<?xml version="1.0"?>
<openerp>
<data>
<template id="res_partner_mails_count_assets_backend"
name="res_partner_mails_count_assets_backend"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script src="/res_partner_mails_count/static/src/js/main.js"
type="text/javascript"></script>
</xpath>
</template>
<record id="view_res_partner_mails_count_info_form" model="ir.ui.view">
<field name="name">res.partner.mails.count</field>
<field name="model">res.partner</field>

2
res_partner_mails_count/views/res_partner_mails_count.xml

@ -6,7 +6,7 @@
<field name="tag">mail.chat.instant_messaging</field>
<field name="res_model">mail.message</field>
<field name="context">{
'ignore_search_model': True,
'active_id': 'channel_archive'
}</field>
<field name="help" type="html">
<p>

Loading…
Cancel
Save