From 94db51e4751d2d55ab05b69ded45a7f6a52bd61e Mon Sep 17 00:00:00 2001 From: ArtyomLosev Date: Tue, 28 Nov 2017 17:13:03 +0500 Subject: [PATCH] [PORT] mail_to to 11.0 --- mail_to/README.rst | 6 ++-- mail_to/__openerp__.py | 4 +-- mail_to/doc/changelog.rst | 5 ++++ mail_to/static/src/js/mail_to.js | 47 ++++++++++++++++---------------- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/mail_to/README.rst b/mail_to/README.rst index b69a51c..86455d9 100644 --- a/mail_to/README.rst +++ b/mail_to/README.rst @@ -21,12 +21,12 @@ Maintainers Further information =================== -Demo: http://runbot.it-projects.info/demo/mail-addons/10.0 +Demo: http://runbot.it-projects.info/demo/mail-addons/11.0 -HTML Description: https://apps.odoo.com/apps/modules/10.0/mail_to/ +HTML Description: https://apps.odoo.com/apps/modules/11.0/mail_to/ Usage instructions: ``_ Changelog: ``_ -Tested on Odoo 10.0 ffba5c688ff74a0630f9f70be1d7760a43a7deba +Tested on Odoo 11.0 ecbf7aa4714479229658d14cce28fa00376ed390 diff --git a/mail_to/__openerp__.py b/mail_to/__openerp__.py index b51527b..8f0d91a 100644 --- a/mail_to/__openerp__.py +++ b/mail_to/__openerp__.py @@ -4,7 +4,7 @@ "summary": """Allows you be sure, that all discussion participants were notified""", "category": "Discuss", "images": ['images/1.png'], - "version": "1.0.1", + "version": "1.0.2", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", @@ -24,6 +24,6 @@ 'static/src/xml/recipient.xml', ], "demo": [], - "installable": False, + "installable": True, "auto_install": False, } diff --git a/mail_to/doc/changelog.rst b/mail_to/doc/changelog.rst index ea27aff..c1d4ae6 100644 --- a/mail_to/doc/changelog.rst +++ b/mail_to/doc/changelog.rst @@ -1,3 +1,8 @@ +`1.0.2` +------- + +- **PORT:** Ported to Odoo 11.0. + `1.0.1` ------- diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js index bb24815..b9b4eec 100644 --- a/mail_to/static/src/js/mail_to.js +++ b/mail_to/static/src/js/mail_to.js @@ -1,31 +1,30 @@ odoo.define('mail_to.MailTo', function (require) { "use strict"; - var base_obj = require('mail_base.base'); +var chat_manager = require('mail_base.base').chat_manager; - base_obj.MailTools.include({ - make_message: function(data){ - var msg = this._super(data); - msg.partner_ids = data.partner_ids; - if (!msg.partner_ids) { - return msg; +var make_message_super = chat_manager.make_message; +chat_manager.make_message = function (data) { + var msg = make_message_super.call(this, data); + msg.partner_ids = data.partner_ids; + if (!msg.partner_ids) { + return msg; + } + var more_recipients = ''; + // value which define more recipients + msg.more_recipients_value = 4; + for (var i = 0; i < msg.partner_ids.length; i++){ + if (i >= msg.more_recipients_value){ + // append names + more_recipients += msg.partner_ids[i][1]; + // separate them with semicolon + if (i < msg.partner_ids.length - 1){ + more_recipients += '; '; } - - var more_recipients = ''; - // value which define more recipients - msg.more_recipients_value = 4; - for (var i = 0; i < msg.partner_ids.length; i++){ - if (i >= msg.more_recipients_value){ - // append names - more_recipients += msg.partner_ids[i][1]; - // separate them with semicolon - if (i < msg.partner_ids.length - 1){ - more_recipients += '; '; - } - } - } - msg.more_recipients = more_recipients; - return msg; } - }); + } + msg.more_recipients = more_recipients; + return msg; +} + return chat_manager; });