From 15194698f6e8b37476a973839d4a31ed844a0ab5 Mon Sep 17 00:00:00 2001 From: Translation Bot Date: Sun, 22 Apr 2018 04:01:19 +0500 Subject: [PATCH 1/8] [i18n] New Translations! We need your help ... to translate more: https://www.it-projects.info/page/translate --- mail_base/i18n/pt.po | 29 ++++++++++++++++++ mail_base/i18n/pt_BR.po | 29 ++++++++++++++++++ mail_sent/i18n/pt.po | 68 ++++++++++++++++++++--------------------- mail_sent/i18n/pt_BR.po | 68 ++++++++++++++++++++--------------------- 4 files changed, 124 insertions(+), 70 deletions(-) create mode 100644 mail_base/i18n/pt.po create mode 100644 mail_base/i18n/pt_BR.po diff --git a/mail_base/i18n/pt.po b/mail_base/i18n/pt.po new file mode 100644 index 0000000..cb7b24e --- /dev/null +++ b/mail_base/i18n/pt.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_base +# +# Translators: +# Translation Bot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 00:05+0000\n" +"PO-Revision-Date: 2018-04-21 00:05+0000\n" +"Last-Translator: Translation Bot , 2018\n" +"Language-Team: Portuguese (https://www.transifex.com/it-projects-llc/teams/76080/pt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mail_base +#: model:ir.model,name:mail_base.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistente de composição de Email" + +#. module: mail_base +#: model:ir.model,name:mail_base.model_mail_message +msgid "Message" +msgstr "Mensagem" diff --git a/mail_base/i18n/pt_BR.po b/mail_base/i18n/pt_BR.po new file mode 100644 index 0000000..9a74270 --- /dev/null +++ b/mail_base/i18n/pt_BR.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_base +# +# Translators: +# Translation Bot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 00:05+0000\n" +"PO-Revision-Date: 2018-04-21 00:05+0000\n" +"Last-Translator: Translation Bot , 2018\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/it-projects-llc/teams/76080/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mail_base +#: model:ir.model,name:mail_base.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Assistente de Composição de Email" + +#. module: mail_base +#: model:ir.model,name:mail_base.model_mail_message +msgid "Message" +msgstr "Mensagem" diff --git a/mail_sent/i18n/pt.po b/mail_sent/i18n/pt.po index f798914..0f7bf6f 100644 --- a/mail_sent/i18n/pt.po +++ b/mail_sent/i18n/pt.po @@ -1,36 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * mail_sent -# +# * mail_sent +# +# Translators: +# Translation Bot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-29 18:57+0000\n" -"PO-Revision-Date: 2017-03-29 18:57+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2018-04-21 00:05+0000\n" +"PO-Revision-Date: 2018-04-21 00:05+0000\n" +"Last-Translator: Translation Bot , 2018\n" +"Language-Team: Portuguese (https://www.transifex.com/it-projects-llc/teams/76080/pt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: mail_sent -#: model:ir.actions.client,help:mail_sent.action_mail_sent_feeds -msgid "

\n" -" No message found and no message sent yet.\n" -"

\n" -" Click on the top-right icon to compose a message. This\n" -" message will be sent by email if it's an internal contact.\n" -"

\n" -" " -msgstr "

\n" -" Nenhuma mensagem encontrada e nenhuma enviada ainda.\n" -"

\n" -" Clique no ícone no canto superior direito para compor uma nova mensagem.\n" -" Esta mensagem será enviada por e-mail se não for um contato interno.\n" -"

\n" -" " +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mail_sent #: model:ir.model,name:mail_sent.model_mail_compose_message @@ -43,25 +29,37 @@ msgid "Message" msgstr "Mensagem" #. module: mail_sent -#: model:ir.model,name:mail_sent.model_mail_notification -msgid "Notifications" -msgstr "Notificações" +#. openerp-web +#: code:addons/mail_sent/static/src/xml/menu.xml:15 +#, python-format +msgid "No sent messages" +msgstr "" #. module: mail_sent -#: model:ir.actions.client,name:mail_sent.action_mail_sent_feeds -#: model:ir.ui.menu,name:mail_sent.mail_sentfeeds -#: field:mail.compose.message,sent:0 -#: field:mail.message,sent:0 +#. openerp-web +#: code:addons/mail_sent/static/src/js/sent.js:61 +#: code:addons/mail_sent/static/src/xml/menu.xml:7 +#: model:ir.model.fields,field_description:mail_sent.field_mail_compose_message_sent +#: model:ir.model.fields,field_description:mail_sent.field_mail_mail_sent +#: model:ir.model.fields,field_description:mail_sent.field_mail_message_sent +#, python-format msgid "Sent" msgstr "Enviados" #. module: mail_sent -#: help:mail.message,sent:0 +#: model:ir.model.fields,help:mail_sent.field_mail_mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_message_sent msgid "Was message sent to someone" msgstr "Foi enviada mensagem para alguém" #. module: mail_sent -#: help:mail.compose.message,sent:0 +#. openerp-web +#: code:addons/mail_sent/static/src/xml/menu.xml:16 +#, python-format +msgid "You can send messages and then these messages will appear here." +msgstr "" + +#. module: mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_compose_message_sent msgid "dummy field to fix inherit error" msgstr "campo fictício para corrigir o erro da herança" - diff --git a/mail_sent/i18n/pt_BR.po b/mail_sent/i18n/pt_BR.po index 8cc602d..491aafc 100644 --- a/mail_sent/i18n/pt_BR.po +++ b/mail_sent/i18n/pt_BR.po @@ -1,36 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * mail_sent -# +# * mail_sent +# +# Translators: +# Translation Bot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-29 18:57+0000\n" -"PO-Revision-Date: 2017-03-29 18:57+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2018-04-21 00:05+0000\n" +"PO-Revision-Date: 2018-04-21 00:05+0000\n" +"Last-Translator: Translation Bot , 2018\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/it-projects-llc/teams/76080/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: mail_sent -#: model:ir.actions.client,help:mail_sent.action_mail_sent_feeds -msgid "

\n" -" No message found and no message sent yet.\n" -"

\n" -" Click on the top-right icon to compose a message. This\n" -" message will be sent by email if it's an internal contact.\n" -"

\n" -" " -msgstr "

\n" -" Nenhuma mensagem encontrada e nenhuma enviada ainda.\n" -"

\n" -" Clique no ícone no canto superior direito para compor uma nova mensagem.\n" -" Esta mensagem será enviada por e-mail se não for um contato interno.\n" -"

\n" -" " +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: mail_sent #: model:ir.model,name:mail_sent.model_mail_compose_message @@ -43,25 +29,37 @@ msgid "Message" msgstr "Mensagem" #. module: mail_sent -#: model:ir.model,name:mail_sent.model_mail_notification -msgid "Notifications" -msgstr "Notificações" +#. openerp-web +#: code:addons/mail_sent/static/src/xml/menu.xml:15 +#, python-format +msgid "No sent messages" +msgstr "" #. module: mail_sent -#: model:ir.actions.client,name:mail_sent.action_mail_sent_feeds -#: model:ir.ui.menu,name:mail_sent.mail_sentfeeds -#: field:mail.compose.message,sent:0 -#: field:mail.message,sent:0 +#. openerp-web +#: code:addons/mail_sent/static/src/js/sent.js:61 +#: code:addons/mail_sent/static/src/xml/menu.xml:7 +#: model:ir.model.fields,field_description:mail_sent.field_mail_compose_message_sent +#: model:ir.model.fields,field_description:mail_sent.field_mail_mail_sent +#: model:ir.model.fields,field_description:mail_sent.field_mail_message_sent +#, python-format msgid "Sent" msgstr "Enviados" #. module: mail_sent -#: help:mail.message,sent:0 +#: model:ir.model.fields,help:mail_sent.field_mail_mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_message_sent msgid "Was message sent to someone" msgstr "Foi enviada mensagem para alguém" #. module: mail_sent -#: help:mail.compose.message,sent:0 +#. openerp-web +#: code:addons/mail_sent/static/src/xml/menu.xml:16 +#, python-format +msgid "You can send messages and then these messages will appear here." +msgstr "" + +#. module: mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_compose_message_sent msgid "dummy field to fix inherit error" msgstr "campo fictício para corrigir o erro da herança" - From fc9aa1e6eaefe45c9d1a94e0d1bc29a3b9789845 Mon Sep 17 00:00:00 2001 From: Translation Bot Date: Sun, 6 May 2018 04:01:36 +0500 Subject: [PATCH 2/8] [i18n] New Translations! We need your help ... to translate more: https://www.it-projects.info/page/translate --- mail_all/i18n/es.po | 34 +++++++++++++++++++++ mail_archives/i18n/es.po | 34 +++++++++++++++++++++ mail_base/i18n/es.po | 29 ++++++++++++++++++ mail_sent/i18n/es.po | 65 ++++++++++++++++++++++++++++++++++++++++ mail_to/i18n/es.po | 40 +++++++++++++++++++++++++ 5 files changed, 202 insertions(+) create mode 100644 mail_all/i18n/es.po create mode 100644 mail_archives/i18n/es.po create mode 100644 mail_base/i18n/es.po create mode 100644 mail_sent/i18n/es.po create mode 100644 mail_to/i18n/es.po diff --git a/mail_all/i18n/es.po b/mail_all/i18n/es.po new file mode 100644 index 0000000..bc912ed --- /dev/null +++ b/mail_all/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_all +# +# Translators: +# Randall Castro , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 23:07+0000\n" +"PO-Revision-Date: 2018-04-21 23:07+0000\n" +"Last-Translator: Randall Castro , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/teams/76080/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mail_all +#. openerp-web +#: code:addons/mail_all/static/src/js/mail_all.js:49 +#: code:addons/mail_all/static/src/xml/menu.xml:7 +#, python-format +msgid "All messages" +msgstr "Todos los mensajes" + +#. module: mail_all +#. openerp-web +#: code:addons/mail_all/static/src/xml/menu.xml:15 +#, python-format +msgid "No messages" +msgstr "Sin mensajes" diff --git a/mail_archives/i18n/es.po b/mail_archives/i18n/es.po new file mode 100644 index 0000000..0ebdd2a --- /dev/null +++ b/mail_archives/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_archives +# +# Translators: +# Randall Castro , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 23:07+0000\n" +"PO-Revision-Date: 2018-04-21 23:07+0000\n" +"Last-Translator: Randall Castro , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/teams/76080/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mail_archives +#. openerp-web +#: code:addons/mail_archives/static/src/js/archives.js:68 +#: code:addons/mail_archives/static/src/xml/menu.xml:7 +#, python-format +msgid "Archive" +msgstr "Archivo" + +#. module: mail_archives +#. openerp-web +#: code:addons/mail_archives/static/src/xml/menu.xml:15 +#, python-format +msgid "Archive is empty" +msgstr "Archivo está vacío" diff --git a/mail_base/i18n/es.po b/mail_base/i18n/es.po new file mode 100644 index 0000000..c2e5a92 --- /dev/null +++ b/mail_base/i18n/es.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_base +# +# Translators: +# Randall Castro , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 23:07+0000\n" +"PO-Revision-Date: 2018-04-21 23:07+0000\n" +"Last-Translator: Randall Castro , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/teams/76080/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mail_base +#: model:ir.model,name:mail_base.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Asistente para composición de correo" + +#. module: mail_base +#: model:ir.model,name:mail_base.model_mail_message +msgid "Message" +msgstr "Mensaje" diff --git a/mail_sent/i18n/es.po b/mail_sent/i18n/es.po new file mode 100644 index 0000000..778c97e --- /dev/null +++ b/mail_sent/i18n/es.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_sent +# +# Translators: +# Randall Castro , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 23:07+0000\n" +"PO-Revision-Date: 2018-04-21 23:07+0000\n" +"Last-Translator: Randall Castro , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/teams/76080/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mail_sent +#: model:ir.model,name:mail_sent.model_mail_compose_message +msgid "Email composition wizard" +msgstr "Asistente para composición de correo" + +#. module: mail_sent +#: model:ir.model,name:mail_sent.model_mail_message +msgid "Message" +msgstr "Mensaje" + +#. module: mail_sent +#. openerp-web +#: code:addons/mail_sent/static/src/xml/menu.xml:15 +#, python-format +msgid "No sent messages" +msgstr "Sin mensajes enviados" + +#. module: mail_sent +#. openerp-web +#: code:addons/mail_sent/static/src/js/sent.js:61 +#: code:addons/mail_sent/static/src/xml/menu.xml:7 +#: model:ir.model.fields,field_description:mail_sent.field_mail_compose_message_sent +#: model:ir.model.fields,field_description:mail_sent.field_mail_mail_sent +#: model:ir.model.fields,field_description:mail_sent.field_mail_message_sent +#, python-format +msgid "Sent" +msgstr "Enviado" + +#. module: mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_message_sent +msgid "Was message sent to someone" +msgstr "Mensaje fué enviado a alguien" + +#. module: mail_sent +#. openerp-web +#: code:addons/mail_sent/static/src/xml/menu.xml:16 +#, python-format +msgid "You can send messages and then these messages will appear here." +msgstr "Puede enviar mensajes y estos mensajes aparecerán aquí." + +#. module: mail_sent +#: model:ir.model.fields,help:mail_sent.field_mail_compose_message_sent +msgid "dummy field to fix inherit error" +msgstr "campo ficticio para corregir el error heredado" diff --git a/mail_to/i18n/es.po b/mail_to/i18n/es.po new file mode 100644 index 0000000..88ba6f7 --- /dev/null +++ b/mail_to/i18n/es.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_to +# +# Translators: +# Randall Castro , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-21 23:07+0000\n" +"PO-Revision-Date: 2018-04-21 23:07+0000\n" +"Last-Translator: Randall Castro , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/teams/76080/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mail_to +#. openerp-web +#: code:addons/mail_to/static/src/xml/recipient.xml:6 +#, python-format +msgid "To:" +msgstr "Para:" + +#. module: mail_to +#. openerp-web +#: code:addons/mail_to/static/src/xml/recipient.xml:15 +#, python-format +msgid "and" +msgstr "y" + +#. module: mail_to +#. openerp-web +#: code:addons/mail_to/static/src/xml/recipient.xml:16 +#, python-format +msgid "more" +msgstr "más" From 509a41073be84ddb946a5fe535e16f4406573135 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 16 May 2018 01:28:08 +0500 Subject: [PATCH 3/8] [LINT] no need utf-8 in py3 --- mail_all/__init__.py | 1 - mail_all/__openerp__.py | 1 - mail_all/tests/__init__.py | 1 - mail_all/tests/test_js.py | 1 - mail_archives/__init__.py | 1 - mail_archives/__openerp__.py | 1 - mail_archives/tests/__init__.py | 1 - mail_archives/tests/test_js.py | 1 - mail_base/__init__.py | 1 - mail_base/__openerp__.py | 1 - mail_base/controllers/main.py | 1 - mail_base/models.py | 1 - mail_base/tests/__init__.py | 1 - mail_base/tests/test_default.py | 1 - mail_check_immediately/__init__.py | 1 - mail_check_immediately/__openerp__.py | 1 - mail_check_immediately/models.py | 1 - mail_fix_553/__init__.py | 1 - mail_fix_553/__openerp__.py | 1 - mail_fix_553/mail_fix_553.py | 1 - mail_move_message/__init__.py | 1 - mail_move_message/__openerp__.py | 1 - mail_move_message/controllers/__init__.py | 1 - mail_move_message/controllers/main.py | 1 - mail_move_message/mail_move_message_models.py | 1 - mail_private/__init__.py | 1 - mail_private/__openerp__.py | 1 - mail_private/models.py | 1 - mail_recovery/__init__.py | 1 - mail_recovery/__openerp__.py | 1 - mail_reply/__init__.py | 1 - mail_reply/__openerp__.py | 1 - mail_reply/tests/__init__.py | 1 - mail_reply/tests/test_default.py | 1 - mail_sent/__init__.py | 1 - mail_sent/__openerp__.py | 1 - mail_sent/models.py | 1 - mail_sent/tests/__init__.py | 1 - mail_sent/tests/test_js.py | 1 - mail_to/__init__.py | 1 - mail_to/__openerp__.py | 1 - mailgun/__init__.py | 1 - mailgun/__openerp__.py | 1 - mailgun/controllers/__init__.py | 1 - mailgun/controllers/main.py | 1 - mailgun/models.py | 1 - res_partner_company_messages/__init__.py | 1 - res_partner_company_messages/__openerp__.py | 1 - res_partner_company_messages/models.py | 1 - res_partner_mails_count/__init__.py | 1 - res_partner_mails_count/__openerp__.py | 1 - res_partner_mails_count/models.py | 1 - res_partner_mails_count/tests/__init__.py | 1 - res_partner_mails_count/tests/test_mail.py | 1 - res_partner_mails_count/tests/test_phantom.py | 1 - 55 files changed, 55 deletions(-) diff --git a/mail_all/__init__.py b/mail_all/__init__.py index 40a96af..e69de29 100644 --- a/mail_all/__init__.py +++ b/mail_all/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/mail_all/__openerp__.py b/mail_all/__openerp__.py index 0d78721..2c8609b 100644 --- a/mail_all/__openerp__.py +++ b/mail_all/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": "Show all messages", "summary": """Checkout all messages where you have access""", diff --git a/mail_all/tests/__init__.py b/mail_all/tests/__init__.py index cadc614..a43ec20 100644 --- a/mail_all/tests/__init__.py +++ b/mail_all/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import test_js diff --git a/mail_all/tests/test_js.py b/mail_all/tests/test_js.py index f001c6b..da8cf40 100644 --- a/mail_all/tests/test_js.py +++ b/mail_all/tests/test_js.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import odoo.tests diff --git a/mail_archives/__init__.py b/mail_archives/__init__.py index 40a96af..e69de29 100644 --- a/mail_archives/__init__.py +++ b/mail_archives/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/mail_archives/__openerp__.py b/mail_archives/__openerp__.py index 8dd83b3..e997ef6 100644 --- a/mail_archives/__openerp__.py +++ b/mail_archives/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": "Mail archives", "summary": """Adds menu to find old messages""", diff --git a/mail_archives/tests/__init__.py b/mail_archives/tests/__init__.py index cadc614..a43ec20 100644 --- a/mail_archives/tests/__init__.py +++ b/mail_archives/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import test_js diff --git a/mail_archives/tests/test_js.py b/mail_archives/tests/test_js.py index ecb0384..e8f9457 100644 --- a/mail_archives/tests/test_js.py +++ b/mail_archives/tests/test_js.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import odoo.tests diff --git a/mail_base/__init__.py b/mail_base/__init__.py index c3d410e..7cdad7f 100644 --- a/mail_base/__init__.py +++ b/mail_base/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import models from . import controllers diff --git a/mail_base/__openerp__.py b/mail_base/__openerp__.py index ce01512..cd5b246 100644 --- a/mail_base/__openerp__.py +++ b/mail_base/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": "Mail Base", "summary": """Makes Mail extendable""", diff --git a/mail_base/controllers/main.py b/mail_base/controllers/main.py index 06f8695..a7d27f7 100644 --- a/mail_base/controllers/main.py +++ b/mail_base/controllers/main.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from openerp.http import request from openerp.addons.bus.controllers.main import BusController diff --git a/mail_base/models.py b/mail_base/models.py index 953f49f..9bdf491 100644 --- a/mail_base/models.py +++ b/mail_base/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from openerp import api, models diff --git a/mail_base/tests/__init__.py b/mail_base/tests/__init__.py index 589cffd..8f6e743 100644 --- a/mail_base/tests/__init__.py +++ b/mail_base/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import test_default diff --git a/mail_base/tests/test_default.py b/mail_base/tests/test_default.py index ca0614c..ba99163 100644 --- a/mail_base/tests/test_default.py +++ b/mail_base/tests/test_default.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import odoo.tests diff --git a/mail_check_immediately/__init__.py b/mail_check_immediately/__init__.py index a0fdc10..0650744 100644 --- a/mail_check_immediately/__init__.py +++ b/mail_check_immediately/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/mail_check_immediately/__openerp__.py b/mail_check_immediately/__openerp__.py index 2bfb6a4..621ac88 100644 --- a/mail_check_immediately/__openerp__.py +++ b/mail_check_immediately/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { 'name': 'Check mail immediately', 'version': '1.0.1', diff --git a/mail_check_immediately/models.py b/mail_check_immediately/models.py index 836bdb7..3a07ab4 100644 --- a/mail_check_immediately/models.py +++ b/mail_check_immediately/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import datetime from openerp.tools.translate import _ diff --git a/mail_fix_553/__init__.py b/mail_fix_553/__init__.py index e9ad948..169f088 100644 --- a/mail_fix_553/__init__.py +++ b/mail_fix_553/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import mail_fix_553 diff --git a/mail_fix_553/__openerp__.py b/mail_fix_553/__openerp__.py index 46e70f0..adb3140 100644 --- a/mail_fix_553/__openerp__.py +++ b/mail_fix_553/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": "Fix mail error 553", "version": "0.3", diff --git a/mail_fix_553/mail_fix_553.py b/mail_fix_553/mail_fix_553.py index 003af81..a5f474d 100644 --- a/mail_fix_553/mail_fix_553.py +++ b/mail_fix_553/mail_fix_553.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import base64 import logging diff --git a/mail_move_message/__init__.py b/mail_move_message/__init__.py index 9f91a71..45edf0d 100644 --- a/mail_move_message/__init__.py +++ b/mail_move_message/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import controllers from . import mail_move_message_models diff --git a/mail_move_message/__openerp__.py b/mail_move_message/__openerp__.py index 29880f0..bdb65ad 100644 --- a/mail_move_message/__openerp__.py +++ b/mail_move_message/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { 'name': 'Mail relocation', 'version': '1.0.5', diff --git a/mail_move_message/controllers/__init__.py b/mail_move_message/controllers/__init__.py index 757b12a..12a7e52 100644 --- a/mail_move_message/controllers/__init__.py +++ b/mail_move_message/controllers/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import main diff --git a/mail_move_message/controllers/main.py b/mail_move_message/controllers/main.py index bb51fc8..69b061f 100644 --- a/mail_move_message/controllers/main.py +++ b/mail_move_message/controllers/main.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from odoo.addons.web.controllers.main import DataSet from odoo.tools.translate import _ from odoo import http diff --git a/mail_move_message/mail_move_message_models.py b/mail_move_message/mail_move_message_models.py index 6732e83..d5e7076 100644 --- a/mail_move_message/mail_move_message_models.py +++ b/mail_move_message/mail_move_message_models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from openerp import api from openerp import fields from openerp import models diff --git a/mail_private/__init__.py b/mail_private/__init__.py index cde864b..a9e3372 100644 --- a/mail_private/__init__.py +++ b/mail_private/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/mail_private/__openerp__.py b/mail_private/__openerp__.py index 80d96d0..7cd6ffc 100644 --- a/mail_private/__openerp__.py +++ b/mail_private/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": """Internal Messaging""", "summary": """Send private messages to specified recipients, regardless of who are in followers list.""", diff --git a/mail_private/models.py b/mail_private/models.py index 1f69756..3a7b545 100644 --- a/mail_private/models.py +++ b/mail_private/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from odoo import models, fields, api diff --git a/mail_recovery/__init__.py b/mail_recovery/__init__.py index 40a96af..e69de29 100644 --- a/mail_recovery/__init__.py +++ b/mail_recovery/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/mail_recovery/__openerp__.py b/mail_recovery/__openerp__.py index 9dafaf9..6d866f8 100644 --- a/mail_recovery/__openerp__.py +++ b/mail_recovery/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { 'name': "Mail Recovery", 'summary': """Backup and recover unsent message""", diff --git a/mail_reply/__init__.py b/mail_reply/__init__.py index 40a96af..e69de29 100644 --- a/mail_reply/__init__.py +++ b/mail_reply/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/mail_reply/__openerp__.py b/mail_reply/__openerp__.py index fefbec4..d6d7f2f 100644 --- a/mail_reply/__openerp__.py +++ b/mail_reply/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": """Always show reply button""", "summary": """Got a message out of a Record? Now you can reply to it too!""", diff --git a/mail_reply/tests/__init__.py b/mail_reply/tests/__init__.py index 589cffd..8f6e743 100644 --- a/mail_reply/tests/__init__.py +++ b/mail_reply/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import test_default diff --git a/mail_reply/tests/test_default.py b/mail_reply/tests/test_default.py index d6c0da9..e3ae355 100644 --- a/mail_reply/tests/test_default.py +++ b/mail_reply/tests/test_default.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import odoo.tests diff --git a/mail_sent/__init__.py b/mail_sent/__init__.py index a0fdc10..0650744 100644 --- a/mail_sent/__init__.py +++ b/mail_sent/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/mail_sent/__openerp__.py b/mail_sent/__openerp__.py index 1e9ffda..7b9b0c1 100644 --- a/mail_sent/__openerp__.py +++ b/mail_sent/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": "Sentbox", "summary": """Quick way to find sent messages""", diff --git a/mail_sent/models.py b/mail_sent/models.py index bb63284..84936e9 100644 --- a/mail_sent/models.py +++ b/mail_sent/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from odoo import api, models, fields diff --git a/mail_sent/tests/__init__.py b/mail_sent/tests/__init__.py index cadc614..a43ec20 100644 --- a/mail_sent/tests/__init__.py +++ b/mail_sent/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import test_js diff --git a/mail_sent/tests/test_js.py b/mail_sent/tests/test_js.py index 6c70337..9dd4342 100644 --- a/mail_sent/tests/test_js.py +++ b/mail_sent/tests/test_js.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import odoo.tests diff --git a/mail_to/__init__.py b/mail_to/__init__.py index 40a96af..e69de29 100644 --- a/mail_to/__init__.py +++ b/mail_to/__init__.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/mail_to/__openerp__.py b/mail_to/__openerp__.py index 5767214..561b0a3 100644 --- a/mail_to/__openerp__.py +++ b/mail_to/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": """Show message recipients""", "summary": """Allows you be sure, that all discussion participants were notified""", diff --git a/mailgun/__init__.py b/mailgun/__init__.py index 9e5827f..91c5580 100644 --- a/mailgun/__init__.py +++ b/mailgun/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import controllers from . import models diff --git a/mailgun/__openerp__.py b/mailgun/__openerp__.py index b1e1efb..f2bc525 100644 --- a/mailgun/__openerp__.py +++ b/mailgun/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { 'name': "Mailgun", 'author': "IT-Projects LLC, Ildar Nasyrov", diff --git a/mailgun/controllers/__init__.py b/mailgun/controllers/__init__.py index 757b12a..12a7e52 100644 --- a/mailgun/controllers/__init__.py +++ b/mailgun/controllers/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import main diff --git a/mailgun/controllers/main.py b/mailgun/controllers/main.py index 09ac427..afe9bdd 100644 --- a/mailgun/controllers/main.py +++ b/mailgun/controllers/main.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from odoo import http from odoo.http import request import re diff --git a/mailgun/models.py b/mailgun/models.py index db3abb5..43ba8df 100644 --- a/mailgun/models.py +++ b/mailgun/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import requests import simplejson diff --git a/res_partner_company_messages/__init__.py b/res_partner_company_messages/__init__.py index a0fdc10..0650744 100644 --- a/res_partner_company_messages/__init__.py +++ b/res_partner_company_messages/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/res_partner_company_messages/__openerp__.py b/res_partner_company_messages/__openerp__.py index f830bb0..83db3d9 100644 --- a/res_partner_company_messages/__openerp__.py +++ b/res_partner_company_messages/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { 'name': "Aggregate messages from company's contacts", 'version': '1.0.0', diff --git a/res_partner_company_messages/models.py b/res_partner_company_messages/models.py index f1d906a..6898fe1 100644 --- a/res_partner_company_messages/models.py +++ b/res_partner_company_messages/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from openerp import api from openerp import models diff --git a/res_partner_mails_count/__init__.py b/res_partner_mails_count/__init__.py index a0fdc10..0650744 100644 --- a/res_partner_mails_count/__init__.py +++ b/res_partner_mails_count/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/res_partner_mails_count/__openerp__.py b/res_partner_mails_count/__openerp__.py index d159eb1..08d43f8 100644 --- a/res_partner_mails_count/__openerp__.py +++ b/res_partner_mails_count/__openerp__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- { "name": """Partner mails count""", "summary": """Displays amount of incoming and outgoing partner mails.""", diff --git a/res_partner_mails_count/models.py b/res_partner_mails_count/models.py index 48f5328..cb59139 100644 --- a/res_partner_mails_count/models.py +++ b/res_partner_mails_count/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from openerp import models, fields, api diff --git a/res_partner_mails_count/tests/__init__.py b/res_partner_mails_count/tests/__init__.py index c7c5c8e..b3796ad 100644 --- a/res_partner_mails_count/tests/__init__.py +++ b/res_partner_mails_count/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import test_mail # from . import test_phantom diff --git a/res_partner_mails_count/tests/test_mail.py b/res_partner_mails_count/tests/test_mail.py index d96c3b1..e6d0a25 100644 --- a/res_partner_mails_count/tests/test_mail.py +++ b/res_partner_mails_count/tests/test_mail.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from openerp.tests.common import TransactionCase diff --git a/res_partner_mails_count/tests/test_phantom.py b/res_partner_mails_count/tests/test_phantom.py index b6e8a5b..2ac601c 100644 --- a/res_partner_mails_count/tests/test_phantom.py +++ b/res_partner_mails_count/tests/test_phantom.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import odoo.tests From 892eb1017dae90c12029a12740604ea0968a4361 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 16 May 2018 01:34:56 +0500 Subject: [PATCH 4/8] [LINT] fix version format --- mail_all/__openerp__.py | 2 +- mail_archives/__openerp__.py | 2 +- mail_base/__openerp__.py | 2 +- mail_sent/__openerp__.py | 2 +- mail_to/__openerp__.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mail_all/__openerp__.py b/mail_all/__openerp__.py index 2c8609b..1ffed98 100644 --- a/mail_all/__openerp__.py +++ b/mail_all/__openerp__.py @@ -4,7 +4,7 @@ "category": "Discuss", # "live_test_url": "", "images": ['images/1.jpg'], - "version": "1.0.0", + "version": "11.0.1.0.0", "application": False, "author": "IT-Projects LLC, Pavel Romanchenko", diff --git a/mail_archives/__openerp__.py b/mail_archives/__openerp__.py index e997ef6..ca430d2 100644 --- a/mail_archives/__openerp__.py +++ b/mail_archives/__openerp__.py @@ -3,7 +3,7 @@ "summary": """Adds menu to find old messages""", "category": "Discuss", "images": ['images/1.jpg'], - "version": "1.0.0", + "version": "11.0.1.0.0", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_base/__openerp__.py b/mail_base/__openerp__.py index cd5b246..e286f80 100644 --- a/mail_base/__openerp__.py +++ b/mail_base/__openerp__.py @@ -3,7 +3,7 @@ "summary": """Makes Mail extendable""", "category": "Discuss", "images": [], - "version": "1.0.2", + "version": "11.0.1.0.2", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_sent/__openerp__.py b/mail_sent/__openerp__.py index 7b9b0c1..fdc019a 100644 --- a/mail_sent/__openerp__.py +++ b/mail_sent/__openerp__.py @@ -3,7 +3,7 @@ "summary": """Quick way to find sent messages""", "category": "Discuss", "images": ['images/menu.png'], - "version": "1.0.4", + "version": "11.0.1.0.4", "author": "IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_to/__openerp__.py b/mail_to/__openerp__.py index 561b0a3..dcdcf79 100644 --- a/mail_to/__openerp__.py +++ b/mail_to/__openerp__.py @@ -3,7 +3,7 @@ "summary": """Allows you be sure, that all discussion participants were notified""", "category": "Discuss", "images": ['images/1.png'], - "version": "1.0.1", + "version": "11.0.1.0.1", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@it-projects.info", From 5de17cf60759bfcd1b59a541773c60159e70fdea Mon Sep 17 00:00:00 2001 From: ArtyomLosev Date: Wed, 16 May 2018 21:00:48 +0500 Subject: [PATCH 5/8] [11.0][PORT] mail_private (#141) * [11.0][PORT] mail_private * [LINT] lint --- mail_base/static/lib/base.js | 6 + mail_private/__openerp__.py | 2 +- mail_private/models.py | 103 +++++++++- mail_private/static/src/js/mail_private.js | 203 ++++++++++++------- mail_private/static/src/xml/mail_private.xml | 10 +- 5 files changed, 236 insertions(+), 88 deletions(-) diff --git a/mail_base/static/lib/base.js b/mail_base/static/lib/base.js index 2cbcf81..42433e7 100644 --- a/mail_base/static/lib/base.js +++ b/mail_base/static/lib/base.js @@ -877,6 +877,12 @@ chat_manager.post_message = function (data, options) { attachment_ids: data.attachment_ids, }; + // for module mail_private + if (data.is_private) { + msg.is_private = data.is_private; + msg.channel_ids = data.channel_ids; + } + // Replace emojis by their unicode character _.each(_.keys(emoji_unicodes), function (key) { var escaped_key = String(key).replace(/([.*+?=^!:${}()|[\]\/\\])/g, '\\$1'); diff --git a/mail_private/__openerp__.py b/mail_private/__openerp__.py index 7cd6ffc..fdf16ea 100644 --- a/mail_private/__openerp__.py +++ b/mail_private/__openerp__.py @@ -33,5 +33,5 @@ "post_init_hook": None, "auto_install": False, - "installable": False, + "installable": True, } diff --git a/mail_private/models.py b/mail_private/models.py index 3a7b545..dd6b60d 100644 --- a/mail_private/models.py +++ b/mail_private/models.py @@ -6,8 +6,103 @@ class MailComposeMessage(models.TransientModel): is_private = fields.Boolean(string='Send Internal Message') + +class MailMessage(models.Model): + _inherit = 'mail.message' + + is_private = fields.Boolean(string='Send Internal Message') + + def send_recepients_for_internal_message(self, model, domain): + result = [] + default_resource = self.env[model].search(domain) + follower_ids = default_resource.message_follower_ids + + recipient_ids = [r.partner_id for r in follower_ids if r.partner_id] + # channel_ids = [c.channel_id for c in follower_ids if c.channel_id] + + for recipient in recipient_ids: + result.append({ + 'checked': len(recipient.user_ids) > 0, + 'partner_id': recipient.id, + 'full_name': recipient.name, + 'name': recipient.name, + 'email_address': recipient.email, + 'reason': 'Recipient' + }) + + # for channel in channel_ids: + # result.append({ + # 'checked': True, + # 'channel_id': channel.id, + # 'full_name': channel, + # 'name': '# '+channel.name, + # 'reason': 'Channel', + # }) + return result + @api.multi - def send_mail(self, auto_commit=False): - for w in self: - w.is_log = True if w.is_private else w.is_log - super(MailComposeMessage, self).send_mail(auto_commit=False) + def _notify(self, force_send=False, send_after_commit=True, user_signature=True): + self_sudo = self.sudo() + if not self_sudo.is_private: + super(MailMessage, self)._notify(force_send, send_after_commit, user_signature) + else: + self._notify_mail_private(force_send, send_after_commit, user_signature) + + @api.multi + def _notify_mail_private(self, force_send=False, send_after_commit=True, user_signature=True): + """ Compute recipients to notify based on specified recipients and document + followers. Delegate notification to partners to send emails and bus notifications + and to channels to broadcast messages on channels """ + group_user = self.env.ref('base.group_user') + # have a sudoed copy to manipulate partners (public can go here with website modules like forum / blog / ... ) + self_sudo = self.sudo() + + self.ensure_one() + partners_sudo = self_sudo.partner_ids + channels_sudo = self_sudo.channel_ids + + if self_sudo.subtype_id and self.model and self.res_id: + followers = self_sudo.env['mail.followers'].search([ + ('res_model', '=', self.model), + ('res_id', '=', self.res_id), + ('subtype_ids', 'in', self_sudo.subtype_id.id), + ]) + if self_sudo.subtype_id.internal: + followers = followers.filtered(lambda fol: fol.channel_id or (fol.partner_id.user_ids and group_user in fol.partner_id.user_ids[0].mapped('groups_id'))) + channels_sudo |= followers.mapped('channel_id') + + # remove author from notified partners + if not self._context.get('mail_notify_author', False) and self_sudo.author_id: + partners_sudo = partners_sudo - self_sudo.author_id + + # update message, with maybe custom valuesz + message_values = {} + if channels_sudo: + message_values['channel_ids'] = [(6, 0, channels_sudo.ids)] + if partners_sudo: + message_values['needaction_partner_ids'] = [(6, 0, partners_sudo.ids)] + if self.model and self.res_id and hasattr(self.env[self.model], 'message_get_message_notify_values'): + message_values.update(self.env[self.model].browse(self.res_id).message_get_message_notify_values(self, message_values)) + if message_values: + self.write(message_values) + + # notify partners and channels + # those methods are called as SUPERUSER because portal users posting messages + # have no access to partner model. Maybe propagating a real uid could be necessary. + email_channels = channels_sudo.filtered(lambda channel: channel.email_send) + notif_partners = partners_sudo.filtered(lambda partner: 'inbox' in partner.mapped('user_ids.notification_type')) + if email_channels or partners_sudo - notif_partners: + partners_sudo.search([ + '|', + ('id', 'in', (partners_sudo - notif_partners).ids), + ('channel_ids', 'in', email_channels.ids), + ('email', '!=', self_sudo.author_id.email or self_sudo.email_from), + ])._notify(self, force_send=force_send, send_after_commit=send_after_commit, user_signature=user_signature) + channels_sudo._notify(self) + + # Discard cache, because child / parent allow reading and therefore + # change access rights. + if self.parent_id: + self.parent_id.invalidate_cache() + + return True diff --git a/mail_private/static/src/js/mail_private.js b/mail_private/static/src/js/mail_private.js index d311b3c..9ee48e1 100644 --- a/mail_private/static/src/js/mail_private.js +++ b/mail_private/static/src/js/mail_private.js @@ -3,10 +3,11 @@ odoo.define('mail_private', function (require) { var core = require('web.core'); var Chatter = require('mail.Chatter'); -var MailComposer = require('mail_base.base').MailComposer; -var chat_manager = require('mail.chat_manager'); +var ChatterComposer = require('mail.ChatterComposer'); +var chat_manager = require('mail_base.base').chat_manager; var session = require('web.session'); -var Model = require('web.Model'); + +var rpc = require('web.rpc'); var config = require('web.config'); var utils = require('mail.utils'); @@ -18,97 +19,126 @@ Chatter.include({ this.events['click .oe_compose_post_private'] = 'on_open_composer_private_message'; }, - on_post_message: function (message) { - var self = this; - if (this.private) { - message.subtype = false; - } - var options = {model: this.model, res_id: this.res_id}; - chat_manager.post_message(message, options).then( - function () { - self.close_composer(); - if (message.partner_ids.length) { - self.refresh_followers(); - } - }).fail(function () { - // todo: display notification - }); - }, - on_open_composer_private_message: function (event) { var self = this; - this.private = true; - this.get_recipients_for_internal_message().then(function (data) { - self.recipients_for_internal_message = data; - self.open_composer({is_private: true}); + this.fetch_recipients_for_internal_message().then(function (data) { + self._openComposer({ + is_private: true, + suggested_partners: data + }); }); }, - on_open_composer_new_message: function () { - this._super.apply(this, arguments); - this.private = false; - }, - - open_composer: function (options) { + _openComposer: function (options) { var self = this; - this._super.apply(this, arguments); - if (options && options.is_private) { - - this.composer.options.is_private = options.is_private; - - _.each(self.recipients_for_internal_message, function (partner) { - self.composer.suggested_partners.push({ - checked: (partner.user_ids.length > 0), - partner_id: partner.id, - full_name: partner.name, - name: partner.name, - email_address: partner.email, - reason: _.include(partner.user_ids, self.session.uid) - ?'Partner' - :'Follower' + var old_composer = this.composer; + // create the new composer + this.composer = new ChatterComposer(this, this.record.model, options.suggested_partners || [], { + commands_enabled: false, + context: this.context, + input_min_height: 50, + input_max_height: Number.MAX_VALUE, + input_baseline: 14, + is_log: options && options.is_log, + record_name: this.record_name, + default_body: old_composer && old_composer.$input && old_composer.$input.val(), + default_mention_selections: old_composer && old_composer.mention_get_listener_selections(), + is_private: options.is_private + }); + this.composer.on('input_focused', this, function () { + this.composer.mention_set_prefetched_partners(this.mentionSuggestions || []); + }); + this.composer.insertAfter(this.$('.o_chatter_topbar')).then(function () { + // destroy existing composer + if (old_composer) { + old_composer.destroy(); + } + if (!config.device.touch) { + self.composer.focus(); + } + self.composer.on('post_message', self, function (message) { + if (options.is_private) { + self.composer.options.is_log = true; + } + self.fields.thread.postMessage(message).then(function () { + + self._closeComposer(true); + if (self.postRefresh === 'always' || (self.postRefresh === 'recipients' && message.partner_ids.length)) { + self.trigger_up('reload'); + } }); }); - } + var toggle_post_private = self.composer.options.is_private || false; + self.composer.on('need_refresh', self, self.trigger_up.bind(self, 'reload')); + self.composer.on('close_composer', null, self._closeComposer.bind(self, true)); + + self.$el.addClass('o_chatter_composer_active'); + self.$('.o_chatter_button_new_message, .o_chatter_button_log_note, .oe_compose_post_private').removeClass('o_active'); + self.$('.o_chatter_button_new_message').toggleClass('o_active', !self.composer.options.is_log && !self.composer.options.is_private); + self.$('.o_chatter_button_log_note').toggleClass('o_active', (self.composer.options.is_log && !options.is_private)); + self.$('.oe_compose_post_private').toggleClass('o_active', toggle_post_private); + }); }, - get_recipients_for_internal_message: function () { + fetch_recipients_for_internal_message: function () { var self = this; self.result = {}; - return new Model(this.context.default_model).query( - ['message_follower_ids', 'partner_id']).filter( - [['id', '=', self.context.default_res_id]]).all(). - then(function (thread) { - var follower_ids = thread[0].message_follower_ids; - self.result[self.context.default_res_id] = []; - self.customer = thread[0].partner_id; - - // Fetch partner ids - return new Model('mail.followers').call( - 'read', [follower_ids, ['partner_id']]).then(function (res_partners) { - // Filter result and push to array - var res_partners_filtered = _.map(res_partners, function (partner) { - if (partner.partner_id[0] && partner.partner_id[0] !== session.partner_id ) { - return partner.partner_id[0]; - } - }).filter(function (partner) { - return typeof partner !== 'undefined'; - }); - - return new Model('res.partner').call( - 'read', [res_partners_filtered, ['name', 'email', 'user_ids']] - ).then(function (recipients) { - return recipients; - }); - }); + var follower_ids_domain = [['id', '=', self.context.default_res_id]]; + return rpc.query({ + model: 'mail.message', + method: 'send_recepients_for_internal_message', + args: [[], self.context.default_model, follower_ids_domain] + }).then(function (res) { + return _.filter(res, function (obj) { + return obj.partner_id !== session.partner_id; + }); }); } }); -MailComposer.include({ - init: function (parent, dataset, options) { - this._super(parent, dataset, options); +ChatterComposer.include({ + init: function (parent, model, suggested_partners, options) { + this._super(parent, model, suggested_partners, options); this.events['click .oe_composer_uncheck'] = 'on_uncheck_recipients'; + }, + + preprocess_message: function () { + var self = this; + var def = $.Deferred(); + this._super().then(function (message) { + message = _.extend(message, { + subtype: 'mail.mt_comment', + message_type: 'comment', + content_subtype: 'html', + context: self.context, + }); + + // Subtype + if (self.options.is_log) { + message.subtype = 'mail.mt_note'; + } + + if (self.options.is_private) { + message.is_private = true; + message.channel_ids = self.get_checked_channel_ids(); + } + // Partner_ids + if (!self.options.is_log) { + var checked_suggested_partners = self.get_checked_suggested_partners(); + self.check_suggested_partners(checked_suggested_partners).done(function (partner_ids) { + message.partner_ids = (message.partner_ids || []).concat(partner_ids); + // update context + message.context = _.defaults({}, message.context, { + mail_post_autofollow: true, + }); + def.resolve(message); + }); + } else { + def.resolve(message); + } + }); + return def; }, on_uncheck_recipients: function () { @@ -121,7 +151,6 @@ MailComposer.include({ if (!this.do_check_attachment_upload()){ return false; } - var self = this; var recipient_done = $.Deferred(); if (this.options.is_log) { @@ -138,6 +167,7 @@ MailComposer.include({ default_partner_ids: partner_ids, default_is_log: self.options.is_log, mail_post_autofollow: true, + is_private: self.options.is_private, }; if (self.options && self.options.is_private) { @@ -148,7 +178,6 @@ MailComposer.include({ context.default_model = self.context.default_model; context.default_res_id = self.context.default_res_id; } - self.do_action({ type: 'ir.actions.act_window', res_model: 'mail.compose.message', @@ -174,9 +203,27 @@ MailComposer.include({ _.each(checked_partners, function (partner) { partner.checked = true; }); + checked_partners = _.uniq(_.filter(checked_partners, function (obj) { + return obj.reason !== 'Channel'; + })); + this.get_checked_channel_ids(); return checked_partners; }, + get_checked_channel_ids: function () { + var self = this; + var checked_channels = []; + this.$('.o_composer_suggested_partners input:checked').each(function() { + var full_name = $(this).data('fullname'); + checked_channels = checked_channels.concat(_.filter(self.suggested_partners, function(item) { + return full_name === item.full_name; + })); + }); + checked_channels = _.uniq(_.filter(checked_channels, function (obj) { + return obj.reason === 'Channel'; + })); + return _.pluck(checked_channels, 'channel_id'); + } }); }); diff --git a/mail_private/static/src/xml/mail_private.xml b/mail_private/static/src/xml/mail_private.xml index 5607c9e..baadbb5 100644 --- a/mail_private/static/src/xml/mail_private.xml +++ b/mail_private/static/src/xml/mail_private.xml @@ -1,15 +1,15 @@