From 4a6b340026a979d2eea534a57561508eb401472f Mon Sep 17 00:00:00 2001 From: x620 Date: Tue, 26 Apr 2016 18:12:20 +0500 Subject: [PATCH 01/15] [FIX] fixes Recipients field --- mail_base/README.rst | 3 ++- mail_base/__init__.py | 2 ++ mail_base/models.py | 18 ++++++++++++++++++ mail_base/static/src/js/base.js | 2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 mail_base/models.py diff --git a/mail_base/README.rst b/mail_base/README.rst index 9e89d30..5ee7ab2 100644 --- a/mail_base/README.rst +++ b/mail_base/README.rst @@ -2,8 +2,9 @@ Mail Base ========= * makes built-in mail js features extendable. -* handle ``search_default_*`` parameters in context. +* handles ``search_default_*`` parameters in context. * fixes toggling left bar +* fixes Recipients field. Out-of-box this field could be empty. Usage ----- diff --git a/mail_base/__init__.py b/mail_base/__init__.py index 40a96af..c7b5ac7 100644 --- a/mail_base/__init__.py +++ b/mail_base/__init__.py @@ -1 +1,3 @@ # -*- coding: utf-8 -*- + +import models diff --git a/mail_base/models.py b/mail_base/models.py new file mode 100644 index 0000000..ade9a35 --- /dev/null +++ b/mail_base/models.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from openerp import api, models + + +class MailMessage(models.Model): + _inherit = 'mail.message' + + @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 id in triplet[2]: + values['partner_ids'].append((4, id, False)) + return super(MailMessage, self).write(values) diff --git a/mail_base/static/src/js/base.js b/mail_base/static/src/js/base.js index 5a43826..d392668 100644 --- a/mail_base/static/src/js/base.js +++ b/mail_base/static/src/js/base.js @@ -269,6 +269,8 @@ var MailTools = core.Class.extend({ var msg = { id: data.id, author_id: data.author_id, + needaction_partner_ids: data.needaction_partner_ids, + partner_ids: data.partner_ids, body_short: data.body_short || "", body: data.body || "", date: moment(time.str_to_datetime(data.date)), From d90dee942f97d94ce14b6e00415e3d1346415804 Mon Sep 17 00:00:00 2001 From: x620 Date: Tue, 26 Apr 2016 18:14:33 +0500 Subject: [PATCH 02/15] [ADD] mail_to module: display recipients the right of the messages --- mail_to/README.rst | 11 +++++++++++ mail_to/__init__.py | 1 + mail_to/__openerp__.py | 28 ++++++++++++++++++++++++++++ mail_to/doc/changelog.rst | 7 +++++++ mail_to/doc/index.rst | 9 +++++++++ mail_to/models.py | 17 +++++++++++++++++ mail_to/static/src/js/mail_to.js | 17 +++++++++++++++++ mail_to/static/src/xml/recipient.xml | 12 ++++++++++++ mail_to/templates.xml | 12 ++++++++++++ 9 files changed, 114 insertions(+) create mode 100644 mail_to/README.rst create mode 100644 mail_to/__init__.py create mode 100644 mail_to/__openerp__.py create mode 100644 mail_to/doc/changelog.rst create mode 100644 mail_to/doc/index.rst create mode 100644 mail_to/models.py create mode 100644 mail_to/static/src/js/mail_to.js create mode 100644 mail_to/static/src/xml/recipient.xml create mode 100644 mail_to/templates.xml diff --git a/mail_to/README.rst b/mail_to/README.rst new file mode 100644 index 0000000..1220cdb --- /dev/null +++ b/mail_to/README.rst @@ -0,0 +1,11 @@ +========================= + Show message recipients +========================= + +Allows you be sure, that all discussion participants were notified. Adds recipients label the right of message. + +Further information +------------------- +HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_to/ + +Tested on Odoo 9.0 d3dd4161ad0598ebaa659fbd083457c77aa9448d \ No newline at end of file diff --git a/mail_to/__init__.py b/mail_to/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/mail_to/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/mail_to/__openerp__.py b/mail_to/__openerp__.py new file mode 100644 index 0000000..664adc5 --- /dev/null +++ b/mail_to/__openerp__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +{ + "name": """Show message recipients""", + "summary": """Allows you be sure, that all discussion participants were notified""", + "category": "Discuss", + "images": [], + "version": "1.0.0", + + "author": "IT-Projects LLC, Pavel Romanchenko", + "website": "https://it-projects.info", + "license": "LGPL-3", + #"price": 9.00, + #"currency": "EUR", + + "depends": [ + 'mail_base', + ], + "external_dependencies": {"python": [], "bin": []}, + "data": [ + 'templates.xml', + ], + "qweb": [ + 'static/src/xml/recipient.xml', + ], + "demo": [], + "installable": True, + "auto_install": False, +} diff --git a/mail_to/doc/changelog.rst b/mail_to/doc/changelog.rst new file mode 100644 index 0000000..61af251 --- /dev/null +++ b/mail_to/doc/changelog.rst @@ -0,0 +1,7 @@ +Changelog +========= + +`1.0.0` +------- + +- Init version \ No newline at end of file diff --git a/mail_to/doc/index.rst b/mail_to/doc/index.rst new file mode 100644 index 0000000..870e115 --- /dev/null +++ b/mail_to/doc/index.rst @@ -0,0 +1,9 @@ +========================= + Show message recipients +========================= + +Usage +===== + +* Open Discuss menu +* All messages have Recipients info \ No newline at end of file diff --git a/mail_to/models.py b/mail_to/models.py new file mode 100644 index 0000000..b53fc12 --- /dev/null +++ b/mail_to/models.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +from openerp import api, models, fields + + +class MailMessage(models.Model): + _inherit = 'mail.message' + + @api.multi + def message_format(self): + message_values = super(MailMessage, self).message_format() + message_index = {message['id']: message for message in message_values} + for item in self: + msg = message_index.get(item.id) + if msg: + # TODO: найти получателей + msg['recipient'] = 'Recipient' + return message_values diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js new file mode 100644 index 0000000..63b9219 --- /dev/null +++ b/mail_to/static/src/js/mail_to.js @@ -0,0 +1,17 @@ +odoo.define('mail_to.MailTo', function (require) { + "use strict"; + + var Thread = require('mail.ChatThread'); + var Model = require('web.Model'); + + Thread.include({ + render: function (messages, options) { + // for(var i = 0; i < messages.length; i++){ + // var msg = messages[i]; + // msg.needaction_partner_ids = [3]; + // } + // console.log('messages:', messages); + this._super(messages, options); + } + }); +}); diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml new file mode 100644 index 0000000..dddae1d --- /dev/null +++ b/mail_to/static/src/xml/recipient.xml @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/mail_to/templates.xml b/mail_to/templates.xml new file mode 100644 index 0000000..0d763ec --- /dev/null +++ b/mail_to/templates.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file From 367a79573ca071dea34725edc447f3a445e614d3 Mon Sep 17 00:00:00 2001 From: x620 Date: Tue, 26 Apr 2016 18:28:24 +0500 Subject: [PATCH 03/15] [REM] remove unused models.py --- mail_to/models.py | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 mail_to/models.py diff --git a/mail_to/models.py b/mail_to/models.py deleted file mode 100644 index b53fc12..0000000 --- a/mail_to/models.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -from openerp import api, models, fields - - -class MailMessage(models.Model): - _inherit = 'mail.message' - - @api.multi - def message_format(self): - message_values = super(MailMessage, self).message_format() - message_index = {message['id']: message for message in message_values} - for item in self: - msg = message_index.get(item.id) - if msg: - # TODO: найти получателей - msg['recipient'] = 'Recipient' - return message_values From 3bae0358c96fd80af71dbff2c2cc136228b7e0dd Mon Sep 17 00:00:00 2001 From: x620 Date: Wed, 27 Apr 2016 11:30:35 +0500 Subject: [PATCH 04/15] [REF] move append partner_ids parameter for message from base.js to mail_to.js --- mail_base/static/src/js/base.js | 2 -- mail_to/static/src/js/mail_to.js | 17 +++++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/mail_base/static/src/js/base.js b/mail_base/static/src/js/base.js index d392668..5a43826 100644 --- a/mail_base/static/src/js/base.js +++ b/mail_base/static/src/js/base.js @@ -269,8 +269,6 @@ var MailTools = core.Class.extend({ var msg = { id: data.id, author_id: data.author_id, - needaction_partner_ids: data.needaction_partner_ids, - partner_ids: data.partner_ids, body_short: data.body_short || "", body: data.body || "", date: moment(time.str_to_datetime(data.date)), diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js index 63b9219..48f3c6e 100644 --- a/mail_to/static/src/js/mail_to.js +++ b/mail_to/static/src/js/mail_to.js @@ -1,17 +1,14 @@ odoo.define('mail_to.MailTo', function (require) { "use strict"; - var Thread = require('mail.ChatThread'); - var Model = require('web.Model'); + var base_obj = require('mail_base.base'); - Thread.include({ - render: function (messages, options) { - // for(var i = 0; i < messages.length; i++){ - // var msg = messages[i]; - // msg.needaction_partner_ids = [3]; - // } - // console.log('messages:', messages); - this._super(messages, options); + base_obj.MailTools.include({ + make_message: function(data){ + var msg = this._super(data); + msg.partner_ids = data.partner_ids; + // msg.needaction_partner_ids = data.needaction_partner_ids; + return msg; } }); }); From bc20db1c542cfe82565bb0430110b63edca452fe Mon Sep 17 00:00:00 2001 From: x620 Date: Wed, 27 Apr 2016 17:20:38 +0500 Subject: [PATCH 05/15] [FIX] fix error channel_seen function in base.js [FIX] fix error inline method in base.js [ADD] add css file for make grey color for link and display recipients when overmouse [IMP] add "To:" before recipients and make link on recipient name [DOC] add info about old messages in index.rst --- mail_base/static/src/js/base.js | 4 ++-- mail_to/doc/index.rst | 3 ++- mail_to/static/src/css/mail_to.css | 9 +++++++++ mail_to/static/src/xml/recipient.xml | 10 ++++++++-- mail_to/templates.xml | 1 + 5 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 mail_to/static/src/css/mail_to.css diff --git a/mail_base/static/src/js/base.js b/mail_base/static/src/js/base.js index 5a43826..c57ff77 100644 --- a/mail_base/static/src/js/base.js +++ b/mail_base/static/src/js/base.js @@ -845,7 +845,7 @@ chat_manager.undo_mark_as_read = function (message_ids, channel) { chat_manager.mark_channel_as_seen = function (channel) { if (channel.unread_counter > 0 && channel.type !== 'static') { chat_manager.mail_tools.update_channel_unread_counter(channel, 0); - chat_manager.mail_tools.channel_seen(channel); + channel_seen(channel); } }; chat_manager.get_channels = function () { @@ -1043,7 +1043,7 @@ chat_manager.get_channels_preview = function (channels) { }); }; chat_manager.get_message_body_preview = function (message_body) { - return chat_manager.mail_tools.parse_and_transform(message_body, inline); + return chat_manager.mail_tools.parse_and_transform(message_body, chat_manager.mail_tools.inline); }; chat_manager.search_partner = function (search_val, limit) { return PartnerModel.call('im_search', [search_val, limit || 20], {}, {shadow: true}).then(function(result) { diff --git a/mail_to/doc/index.rst b/mail_to/doc/index.rst index 870e115..b661c52 100644 --- a/mail_to/doc/index.rst +++ b/mail_to/doc/index.rst @@ -6,4 +6,5 @@ Usage ===== * Open Discuss menu -* All messages have Recipients info \ No newline at end of file +* All messages have Recipients info +* For messages created before install module it not will work where the recipients is not set \ No newline at end of file diff --git a/mail_to/static/src/css/mail_to.css b/mail_to/static/src/css/mail_to.css new file mode 100644 index 0000000..ef453d6 --- /dev/null +++ b/mail_to/static/src/css/mail_to.css @@ -0,0 +1,9 @@ +.grey { + color: grey; +} +.o_mail_thread .o_thread_message span.recipients_info { + opacity: 0; +} +.o_mail_thread .o_thread_message:hover span.recipients_info { + opacity: 1; +} diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index dddae1d..0790198 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -1,10 +1,16 @@ From 200dc9977fe66f51d344c587108cea7151a38867 Mon Sep 17 00:00:00 2001 From: x620 Date: Wed, 27 Apr 2016 17:53:48 +0500 Subject: [PATCH 06/15] [FIX] fix link error --- mail_to/static/src/xml/recipient.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index 0790198..edead08 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -6,8 +6,6 @@ To: From d66dc99012bfa17a251b02e2932a9d91e31595f4 Mon Sep 17 00:00:00 2001 From: x620 Date: Fri, 29 Apr 2016 12:31:36 +0500 Subject: [PATCH 07/15] [FIX] fix duplicate new messages --- mail_base/static/src/js/base.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mail_base/static/src/js/base.js b/mail_base/static/src/js/base.js index c57ff77..968f48d 100644 --- a/mail_base/static/src/js/base.js +++ b/mail_base/static/src/js/base.js @@ -11,6 +11,7 @@ var time = require('web.time'); var web_client = require('web.web_client'); var _t = core._t; +var _lt = core._lt; var LIMIT = 100; var preview_msg_max_size = 350; // optimal for native english speakers @@ -354,7 +355,7 @@ var MailTools = core.Class.extend({ } else { channel = chat_manager.mail_tools.make_channel(data, options); channels.push(channel); - channels = _.sortBy(channels, function (channel) { return channel.name.toLowerCase(); }); + channels = _.sortBy(channels, function (channel) { return _.isString(channel.name) ? channel.name.toLowerCase() : '' }); if (!options.silent) { chat_manager.bus.trigger("new_channel", channel); } @@ -1059,7 +1060,7 @@ chat_manager.search_partner = function (search_val, limit) { }); }; chat_manager.send_native_notification = function(){ - chat_manager.mail_tools.send_native_notification.apply(chat_manager.mail_tools, arguments) + return chat_manager.mail_tools.send_native_notification.apply(chat_manager.mail_tools, arguments) }; chat_manager.bus.on('client_action_open', null, function (open) { client_action_open = open; @@ -1069,13 +1070,13 @@ chat_manager.bus.on('client_action_open', null, function (open) { function init(){ chat_manager.mail_tools.add_channel({ id: "channel_inbox", - name: _t("Inbox"), + name: _lt("Inbox"), type: "static" }, { display_needactions: true }); chat_manager.mail_tools.add_channel({ id: "channel_starred", - name: _t("Starred"), + name: _lt("Starred"), type: "static" }); From 9c1796f541e8c577aac48a7cdc4c9b1d565cef3b Mon Sep 17 00:00:00 2001 From: x620 Date: Fri, 29 Apr 2016 15:10:31 +0500 Subject: [PATCH 08/15] [FIX] replace _t to _lt in archives.js and sent.js --- mail_archives/static/src/js/archives.js | 4 ++-- mail_sent/static/src/js/sent.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mail_archives/static/src/js/archives.js b/mail_archives/static/src/js/archives.js index 86813fb..912523a 100644 --- a/mail_archives/static/src/js/archives.js +++ b/mail_archives/static/src/js/archives.js @@ -13,7 +13,7 @@ var session = require('web.session'); var time = require('web.time'); var web_client = require('web.web_client'); -var _t = core._t; +var _lt = core._lt; //------------------------------------------------------------------------------- // Inherit class and override methods @@ -44,7 +44,7 @@ base_obj.chat_manager.is_ready.then(function(){ // Add archive channel base_obj.chat_manager.mail_tools.add_channel({ id: "channel_archive", - name: _t("Archive"), + name: _lt("Archive"), type: "static" }); diff --git a/mail_sent/static/src/js/sent.js b/mail_sent/static/src/js/sent.js index e253f29..df2bc11 100644 --- a/mail_sent/static/src/js/sent.js +++ b/mail_sent/static/src/js/sent.js @@ -13,7 +13,7 @@ var session = require('web.session'); var time = require('web.time'); var web_client = require('web.web_client'); -var _t = core._t; +var _lt = core._lt; //------------------------------------------------------------------------------- // Inherit class and override methods @@ -49,7 +49,7 @@ base_obj.chat_manager.is_ready.then(function(){ // Add sent channel base_obj.chat_manager.mail_tools.add_channel({ id: "channel_sent", - name: _t("Sent"), + name: _lt("Sent"), type: "static" }); From 87aaf66674173917d05c6a68975d8f856a758923 Mon Sep 17 00:00:00 2001 From: x620 Date: Fri, 29 Apr 2016 16:44:29 +0500 Subject: [PATCH 09/15] [FIX] unsubscribe and then subscribe to the event, to avoid duplication of new posts in base.js [FIX] replace "needaction_partner_ids" to "partner_ids" in models.py --- mail_base/static/src/js/base.js | 2 ++ mail_sent/models.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mail_base/static/src/js/base.js b/mail_base/static/src/js/base.js index 968f48d..7e7549f 100644 --- a/mail_base/static/src/js/base.js +++ b/mail_base/static/src/js/base.js @@ -1099,6 +1099,8 @@ function init(){ var load_menu_id = ir_model.call("xmlid_to_res_id", ["mail.mail_channel_menu_root_chat"], {}, {shadow: true}); var load_action_id = ir_model.call("xmlid_to_res_id", ["mail.mail_channel_action_client_chat"], {}, {shadow: true}); + // unsubscribe and then subscribe to the event, to avoid duplication of new messages + bus.off('notification'); bus.on('notification', null, chat_manager.mail_tools.on_notification); return $.when(load_menu_id, load_action_id, load_channels, load_emojis).then(function (menu_id, action_id) { diff --git a/mail_sent/models.py b/mail_sent/models.py index a77c2ae..99f4473 100644 --- a/mail_sent/models.py +++ b/mail_sent/models.py @@ -8,13 +8,13 @@ class MailMessage(models.Model): sent = fields.Boolean('Sent', compute="_get_sent", help='Was message sent to someone', store=True) @api.one - @api.depends('author_id', 'needaction_partner_ids') + @api.depends('author_id', 'partner_ids') def _get_sent(self): self_sudo = self.sudo() - self_sudo.sent = len(self_sudo.needaction_partner_ids) > 1 \ - or len(self_sudo.needaction_partner_ids) == 1 \ + self_sudo.sent = len(self_sudo.partner_ids) > 1 \ + or len(self_sudo.partner_ids) == 1 \ and self_sudo.author_id \ - and self_sudo.needaction_partner_ids[0].id != self_sudo.author_id.id + and self_sudo.partner_ids[0].id != self_sudo.author_id.id @api.multi def message_format(self): From f616f3ab001185f51eeecacb53829b59e901c4b6 Mon Sep 17 00:00:00 2001 From: x620 Date: Fri, 29 Apr 2016 17:19:52 +0500 Subject: [PATCH 10/15] [DOC] change Usage description in index.rst --- mail_to/doc/index.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mail_to/doc/index.rst b/mail_to/doc/index.rst index b661c52..b58ea5a 100644 --- a/mail_to/doc/index.rst +++ b/mail_to/doc/index.rst @@ -6,5 +6,6 @@ Usage ===== * Open Discuss menu -* All messages have Recipients info -* For messages created before install module it not will work where the recipients is not set \ No newline at end of file +* Many messages have Recipients info +* For messages created before install module it will not work where the recipients is not set there is not way restore recipients value +* Click Inbox left menu item, click Send mail button, set recipient and send message. This message will show recipient. \ No newline at end of file From a1607e62753acaff02eb59fb952c8c3109e8386c Mon Sep 17 00:00:00 2001 From: x620 Date: Fri, 29 Apr 2016 17:27:17 +0500 Subject: [PATCH 11/15] [DOC] add item about mouseover --- mail_to/doc/index.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mail_to/doc/index.rst b/mail_to/doc/index.rst index b58ea5a..de14c87 100644 --- a/mail_to/doc/index.rst +++ b/mail_to/doc/index.rst @@ -5,7 +5,8 @@ Usage ===== -* Open Discuss menu -* Many messages have Recipients info -* For messages created before install module it will not work where the recipients is not set there is not way restore recipients value -* Click Inbox left menu item, click Send mail button, set recipient and send message. This message will show recipient. \ No newline at end of file +* Open Discuss menu. +* Many messages have Recipients info. +* Click Inbox left menu item, click Send mail button, set recipient and send message. This message will show recipient. +* To see the recipient's need hover the mouse over a message. +* For messages created before install module it will not work where the recipients is not set there is not way restore recipients value. From 3d0b967ffb3bc75debf8b1d90421aafe14413410 Mon Sep 17 00:00:00 2001 From: x620 Date: Sat, 30 Apr 2016 00:42:55 +0500 Subject: [PATCH 12/15] [IMP] opacity more when mouseover [IMP] link black when mouseover [IMP] semicolon between recipients [IMP] more 4 recipients hidden under "more..." and appear when mouseover --- mail_to/static/src/css/mail_to.css | 32 ++++++++++++++++++++++++---- mail_to/static/src/xml/recipient.xml | 18 ++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/mail_to/static/src/css/mail_to.css b/mail_to/static/src/css/mail_to.css index ef453d6..3464d76 100644 --- a/mail_to/static/src/css/mail_to.css +++ b/mail_to/static/src/css/mail_to.css @@ -1,9 +1,33 @@ -.grey { +.recipient_link { color: grey; } -.o_mail_thread .o_thread_message span.recipients_info { - opacity: 0; +.recipient_link:hover { + color: #0d0d0d; } -.o_mail_thread .o_thread_message:hover span.recipients_info { + +.o_mail_thread .o_thread_message span.recipients_info, +.o_mail_thread .o_thread_message i.o_thread_message_star, +.o_mail_thread .o_thread_message i.o_thread_message_reply, +.o_mail_thread .o_thread_message i.o_thread_message_needaction +{ + opacity: 0.5; +} +.o_mail_thread .o_thread_message:hover span.recipients_info, +.o_mail_thread .o_thread_message:hover i.o_thread_message_star, +.o_mail_thread .o_thread_message:hover i.o_thread_message_reply, +.o_mail_thread .o_thread_message:hover i.o_thread_message_needaction +{ opacity: 1; } +.more_4 { + display: none; +} +.more_4_link { + display: block; +} +.o_mail_thread .o_thread_message:hover span.more_4_link { + display: none; +} +.o_mail_thread .o_thread_message:hover span.more_4 { + display: block; +} \ No newline at end of file diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index edead08..f32287e 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -4,10 +4,20 @@ To: - - - + + + + ; + + + + ; + + + + and more... + From 5c3ebca3c600c23f81315f801427fa8c2f157cb0 Mon Sep 17 00:00:00 2001 From: x620 Date: Wed, 4 May 2016 15:26:15 +0500 Subject: [PATCH 13/15] [FIX] default icons opacity - 0.4, mouseover on message - 0.7, mouseover on icon - 1 [FIX] more recipients moved to tooltip --- mail_to/static/src/css/mail_to.css | 26 ++++++++------------------ mail_to/static/src/js/mail_to.js | 15 +++++++++++++++ mail_to/static/src/xml/recipient.xml | 22 +++++++++------------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/mail_to/static/src/css/mail_to.css b/mail_to/static/src/css/mail_to.css index 3464d76..bdbae0d 100644 --- a/mail_to/static/src/css/mail_to.css +++ b/mail_to/static/src/css/mail_to.css @@ -8,26 +8,16 @@ .o_mail_thread .o_thread_message span.recipients_info, .o_mail_thread .o_thread_message i.o_thread_message_star, .o_mail_thread .o_thread_message i.o_thread_message_reply, -.o_mail_thread .o_thread_message i.o_thread_message_needaction -{ - opacity: 0.5; +.o_mail_thread .o_thread_message i.o_thread_message_needaction { + opacity: 0.4; } -.o_mail_thread .o_thread_message:hover span.recipients_info, + .o_mail_thread .o_thread_message:hover i.o_thread_message_star, .o_mail_thread .o_thread_message:hover i.o_thread_message_reply, -.o_mail_thread .o_thread_message:hover i.o_thread_message_needaction -{ - opacity: 1; -} -.more_4 { - display: none; +.o_mail_thread .o_thread_message:hover i.o_thread_message_needaction { + opacity: 0.7; } -.more_4_link { - display: block; -} -.o_mail_thread .o_thread_message:hover span.more_4_link { - display: none; + +.o_mail_thread .o_thread_message:hover span.recipients_info { + opacity: 1; } -.o_mail_thread .o_thread_message:hover span.more_4 { - display: block; -} \ No newline at end of file diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js index 48f3c6e..dfe232e 100644 --- a/mail_to/static/src/js/mail_to.js +++ b/mail_to/static/src/js/mail_to.js @@ -8,6 +8,21 @@ odoo.define('mail_to.MailTo', function (require) { var msg = this._super(data); msg.partner_ids = data.partner_ids; // msg.needaction_partner_ids = data.needaction_partner_ids; + + 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; } }); diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index f32287e..e445b47 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -5,20 +5,16 @@ To: - - + + ; - - - - ; - - - - and more... - - + + + + + + and more + From 41ab50f575b45da8d182bddfa3277270902aa3a3 Mon Sep 17 00:00:00 2001 From: x620 Date: Thu, 5 May 2016 12:01:19 +0500 Subject: [PATCH 14/15] [DOC] change description in index.rst --- mail_to/doc/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_to/doc/index.rst b/mail_to/doc/index.rst index de14c87..db10bef 100644 --- a/mail_to/doc/index.rst +++ b/mail_to/doc/index.rst @@ -9,4 +9,4 @@ Usage * Many messages have Recipients info. * Click Inbox left menu item, click Send mail button, set recipient and send message. This message will show recipient. * To see the recipient's need hover the mouse over a message. -* For messages created before install module it will not work where the recipients is not set there is not way restore recipients value. +* For messages created before install module it will not work where the recipients are not set. There is no way restore recipients value. From ca24ddcfb73492cd158ed5793023a8d18a1800b0 Mon Sep 17 00:00:00 2001 From: x620 Date: Thu, 5 May 2016 12:03:06 +0500 Subject: [PATCH 15/15] [DOC] add "to" in description in index.rst --- mail_to/doc/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_to/doc/index.rst b/mail_to/doc/index.rst index db10bef..31597f2 100644 --- a/mail_to/doc/index.rst +++ b/mail_to/doc/index.rst @@ -9,4 +9,4 @@ Usage * Many messages have Recipients info. * Click Inbox left menu item, click Send mail button, set recipient and send message. This message will show recipient. * To see the recipient's need hover the mouse over a message. -* For messages created before install module it will not work where the recipients are not set. There is no way restore recipients value. +* For messages created before install module it will not work where the recipients are not set. There is no way to restore recipients value.