From f823fa20f5474dbfa4faded603d6c27617620797 Mon Sep 17 00:00:00 2001 From: ommo73 Date: Sat, 26 Oct 2019 17:15:39 +0500 Subject: [PATCH 1/3] :ambulance: mail_to: fixing errors --- mail_to/templates.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/mail_to/templates.xml b/mail_to/templates.xml index 7f14be35..c7eaadec 100644 --- a/mail_to/templates.xml +++ b/mail_to/templates.xml @@ -11,6 +11,7 @@ + From e32a6b7f143197adeb4ce1ca96303ce06be39ad1 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Fri, 8 Nov 2019 09:17:49 +0000 Subject: [PATCH 2/3] :hammer_and_wrench: mail_to: return back broken features --- mail_to/models/mail_message.py | 12 ++++++++++++ mail_to/static/src/js/mail_to.js | 13 +++++++------ mail_to/static/src/xml/recipient.xml | 6 +++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/mail_to/models/mail_message.py b/mail_to/models/mail_message.py index c827072f..f7a75f49 100644 --- a/mail_to/models/mail_message.py +++ b/mail_to/models/mail_message.py @@ -6,6 +6,18 @@ class MailMessage(models.Model): _inherit = 'mail.message' + # взято с mail_base + @api.multi + def write(self, values): + if values.get('needaction_partner_ids'): + if not values.get('partner_ids'): + values['partner_ids'] = [] + for triplet in values.get('needaction_partner_ids'): + if triplet[0] == 6: + for i in triplet[2]: + values['partner_ids'].append((4, i, False)) + return super(MailMessage, self).write(values) + @api.multi def message_format(self): messages_values = super(MailMessage, self).message_format() diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js index 665ee256..7a9d42d4 100644 --- a/mail_to/static/src/js/mail_to.js +++ b/mail_to/static/src/js/mail_to.js @@ -6,11 +6,11 @@ odoo.define('mail_to.MailTo', function (require) { "use strict"; -var chat_manager = require('mail_base.base').chat_manager; + var MailManager = require("mail.Manager"); + MailManager.include({ + _makeMessage: function(data) { + var msg = this._super(data); -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; msg.channel_names = data.channel_names; msg.recipients = data.partner_ids.concat(data.channel_names); @@ -34,7 +34,8 @@ chat_manager.make_message = function (data) { msg.more_recipients = more_recipients; return msg; - }; + } + }); - return chat_manager; + return MailManager; }); diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index 312240a5..cfa3ac2d 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -5,7 +5,7 @@ License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html).-->