diff --git a/.github/workflows/DINAR-PORT.yml b/.github/workflows/DINAR-PORT.yml index 2bbd3e7..88486e7 100644 --- a/.github/workflows/DINAR-PORT.yml +++ b/.github/workflows/DINAR-PORT.yml @@ -96,7 +96,7 @@ jobs: --no-commit \ 2> $LOG_FILE || true cat $LOG_FILE - + # remove colors sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $LOG_FILE # escape character @@ -104,9 +104,9 @@ jobs: body=$(cat $LOG_FILE) body="${body//'%'/'%25'}" body="${body//$'\n'/'%0A'}" - body="${body//$'\r'/'%0D'}" + body="${body//$'\r'/'%0D'}" echo "MIGRATOR_LOGS=$body" >> $GITHUB_ENV - + git add -A git commit -m ":arrow_up:${{ env.PORT_TO_BRANCH_TAGS }} OCA/odoo-module-migrator @@ -137,7 +137,7 @@ jobs: number: ${{ steps.cpr.outputs.pull-request-number }} comment: | [Migrator](https://github.com/OCA/odoo-module-migrator/)'s logs: - + ``` ${{ env.MIGRATOR_LOGS }} ``` diff --git a/mail_base/__manifest__.py b/mail_base/__manifest__.py index 6a68514..27fad67 100644 --- a/mail_base/__manifest__.py +++ b/mail_base/__manifest__.py @@ -7,7 +7,7 @@ "summary": """Makes Mail extendable""", "category": "Discuss", "images": ["images/mail_base_image.png"], - "version": "11.0.1.1.1", + "version": "11.0.1.1.2", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@itpp.dev", "website": "https://it-projects.info", diff --git a/mail_base/doc/changelog.rst b/mail_base/doc/changelog.rst index 83589b0..cd75d3e 100644 --- a/mail_base/doc/changelog.rst +++ b/mail_base/doc/changelog.rst @@ -1,3 +1,8 @@ +`1.1.2` +------- + +**FIX**: random initialization errors + `1.1.1` ------- diff --git a/mail_base/static/lib/base.js b/mail_base/static/lib/base.js index fa9dcbe..609322d 100644 --- a/mail_base/static/lib/base.js +++ b/mail_base/static/lib/base.js @@ -123,6 +123,8 @@ ChatAction.include({ } }); +function init_chat_manager(){ + chat_manager.notify_incoming_message = function (msg, options) { if (bus.is_odoo_focused() && options.is_displayed) { // no need to notify @@ -1409,11 +1411,17 @@ chat_manager.search_partner = function (search_val, limit) { }); } +}; // init_chat_manager + +chat_manager.is_ready = chat_manager.is_ready.then(function(){ + +init_chat_manager(); chat_manager.start(); bus.off('notification'); bus.on('notification', null, function () { chat_manager.on_notification.apply(chat_manager, arguments); }); +}); return { ODOOBOT_ID: ODOOBOT_ID, diff --git a/mail_to/__manifest__.py b/mail_to/__manifest__.py index 3b0841a..5013d8d 100644 --- a/mail_to/__manifest__.py +++ b/mail_to/__manifest__.py @@ -2,13 +2,14 @@ # Copyright 2016,2020 Ivan Yelizariev # Copyright 2018 Ruslan Ronzhin # Copyright 2019 Artem Rafailov +# Copyright 2020 Denis Mudarisov # License MIT (https://opensource.org/licenses/MIT). { "name": """Show message recipients""", "summary": """Allows you be sure, that all discussion participants were notified""", "category": "Discuss", "images": ["images/1.png"], - "version": "11.0.1.1.1", + "version": "11.0.1.1.2", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@itpp.dev", "website": "https://it-projects.info", diff --git a/mail_to/doc/changelog.rst b/mail_to/doc/changelog.rst index de0ff64..6b97eb6 100644 --- a/mail_to/doc/changelog.rst +++ b/mail_to/doc/changelog.rst @@ -1,3 +1,8 @@ +`1.1.2` +------- + +- **Fix:** if open the pop-up chat window and reload the page, then an error might occur randomly + `1.1.1` ------- diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js index 867580f..caeca64 100644 --- a/mail_to/static/src/js/mail_to.js +++ b/mail_to/static/src/js/mail_to.js @@ -2,39 +2,42 @@ * Copyright 2016-2017,2020 Ivan Yelizariev * Copyright 2017 Artyom Losev * Copyright 2019 Artem Rafailov + * Copyright 2020 Denis Mudarisov * License MIT (https://opensource.org/licenses/MIT). */ -odoo.define("mail_to.MailTo", function(require) { +odoo.define("mail_to.MailTo", function (require) { "use strict"; var chat_manager = require("mail_base.base").chat_manager; - 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); - if (!msg.partner_ids && !msg.channel_names) { - return msg; - } + chat_manager.is_ready = chat_manager.is_ready.then(function () { + 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); + 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.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 += "; "; + var more_recipients = ""; + // Value which define more recipients + msg.more_recipients_value = 4; + 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; - }; + msg.more_recipients = more_recipients; + return msg; + }; + }); return chat_manager; }); diff --git a/mail_to/static/src/js/test_mail_to.js b/mail_to/static/src/js/test_mail_to.js index 95db0a8..9c164df 100644 --- a/mail_to/static/src/js/test_mail_to.js +++ b/mail_to/static/src/js/test_mail_to.js @@ -1,6 +1,6 @@ /* Copyright 2018 Artem Rafailov License MIT (https://opensource.org/licenses/MIT).*/ -odoo.define("mail_to.tour", function(require) { +odoo.define("mail_to.tour", function (require) { "use strict"; var tour = require("web_tour.tour"); diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index feccf3c..fab8882 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -8,8 +8,8 @@ - To: - To: + To: + To: - ; + ; ; + > + ; + @@ -35,9 +37,9 @@ class="recipient_link" > - ; + + ; + @@ -46,10 +48,12 @@ t-if="message.recipients.length > message.more_recipients_value" > - and more - + /> + more +