diff --git a/mail_to/__init__.py b/mail_to/__init__.py
index 40a96afc..a0fdc10f 100644
--- a/mail_to/__init__.py
+++ b/mail_to/__init__.py
@@ -1 +1,2 @@
# -*- coding: utf-8 -*-
+from . import models
diff --git a/mail_to/__manifest__.py b/mail_to/__manifest__.py
index 57672148..209b68d8 100644
--- a/mail_to/__manifest__.py
+++ b/mail_to/__manifest__.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
+# Copyright 2019 Artem Rafailov
+# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html).
{
"name": """Show message recipients""",
"summary": """Allows you be sure, that all discussion participants were notified""",
"category": "Discuss",
"images": ['images/1.png'],
- "version": "1.0.1",
+ "version": "10.0.1.1.1",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@it-projects.info",
diff --git a/mail_to/doc/changelog.rst b/mail_to/doc/changelog.rst
index ea27aff2..c376831f 100644
--- a/mail_to/doc/changelog.rst
+++ b/mail_to/doc/changelog.rst
@@ -1,7 +1,13 @@
+`1.1.0`
+-------
+
+- **New**: channels are displayed in recipients
+
+
`1.0.1`
-------
-- **FIX:** The problem with duplicating the names of recipients was solved.
+- **FIX**: the problem with duplicating the names of recipients was solved.
`1.0.0`
-------
diff --git a/mail_to/models/__init__.py b/mail_to/models/__init__.py
new file mode 100644
index 00000000..5327e73e
--- /dev/null
+++ b/mail_to/models/__init__.py
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+from . import mail_message
diff --git a/mail_to/models/mail_message.py b/mail_to/models/mail_message.py
new file mode 100644
index 00000000..a0bc8240
--- /dev/null
+++ b/mail_to/models/mail_message.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Copyright 2019 Artem Rafailov
+# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html).
+from odoo import models, api
+
+
+class MailMessage(models.Model):
+ _inherit = 'mail.message'
+
+ @api.multi
+ def message_format(self):
+ message_values = super(MailMessage, self).message_format()
+ for i in message_values:
+ if i['channel_ids']:
+ i['channel_names'] = []
+ for channel_id in i['channel_ids']:
+ channel = self.env['mail.channel'].search([('id', '=', channel_id)])
+ i['channel_names'].append([channel_id, '#' + channel['display_name']])
+
+ return message_values
diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js
index bb24815c..2b425dca 100644
--- a/mail_to/static/src/js/mail_to.js
+++ b/mail_to/static/src/js/mail_to.js
@@ -1,3 +1,8 @@
+/* Copyright 2016 x620
+ * Copyright 2016-2017 Ivan Yelizariev
+ * Copyright 2017 Artyom Losev
+ * Copyright 2019 Artem Rafailov
+ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). */
odoo.define('mail_to.MailTo', function (require) {
"use strict";
@@ -7,23 +12,26 @@ odoo.define('mail_to.MailTo', function (require) {
make_message: function(data){
var msg = this._super(data);
msg.partner_ids = data.partner_ids;
- if (!msg.partner_ids) {
+ msg.channel_names = data.channel_names;
+ msg.recipients = data.partner_ids.concat(data.channel_names);
+ if (!msg.partner_ids && !msg.channel_names) {
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 += '; ';
+ for (var i = 0; i < msg.recipients.length; i++){
+ if (i >= msg.more_recipients_value){
+ // append names
+ more_recipients += msg.recipients[i][1];
+ // separate them with semicolon
+ if (i < msg.recipients.length - 1){
+ more_recipients += '; ';
+ }
}
- }
}
+
msg.more_recipients = more_recipients;
return msg;
}
diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml
index 3b5a50fd..ede8ecec 100644
--- a/mail_to/static/src/xml/recipient.xml
+++ b/mail_to/static/src/xml/recipient.xml
@@ -1,19 +1,36 @@
+
To:
+ To:
- ;
+ ; ;
-
+
+
+
+
+
+ ;
+
+
+
+
+
+
+
- and more
+ and more
diff --git a/mail_to/templates.xml b/mail_to/templates.xml
index 24b067ad..1f42409a 100644
--- a/mail_to/templates.xml
+++ b/mail_to/templates.xml
@@ -1,4 +1,7 @@
+