diff --git a/mail_activity_board/README.rst b/mail_activity_board/README.rst new file mode 100644 index 00000000..3be9f711 --- /dev/null +++ b/mail_activity_board/README.rst @@ -0,0 +1,108 @@ +=================== +Mail Activity Board +=================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:af48279823f61b13bb70f78b4a28fca06f358bed9d99c66d25c5a5d6ceac611f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/18.0/mail_activity_board + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_activity_board + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds an activity board with form, tree, kanban, calendar, +pivot, graph and search views. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. Access to the views from menu Boards. + +A smartButton of activities is added in the mail thread from form view. +From this smartButton is linked to the activity board, to the view tree, +which shows the activities related to the opportunity. + +From the form view of the activity you can navigate to the origin of the +activity. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* SDi +* David Juaneda +* Sodexis +* ACSONE SA/NV + +Contributors +------------ + +- `SDI `__: + + - David Juaneda + +- `ForgeFlow `__: + + - Miquel Raïch (miquel.raich@forgeflow.com) + +- `Pesol `__: + + - Pedro Gonzalez (pedro.gonzalez@pesol.es) + +- `ACSONE SA/NV `__ + + - Laurent Mignon + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_activity_board/__init__.py b/mail_activity_board/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/mail_activity_board/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_activity_board/__manifest__.py b/mail_activity_board/__manifest__.py new file mode 100644 index 00000000..c5f9705a --- /dev/null +++ b/mail_activity_board/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2018 David Juaneda - +# Copyright 2021 Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Mail Activity Board", + "summary": "Add Activity Boards", + "version": "18.0.1.0.0", + "development_status": "Beta", + "category": "Social Network", + "website": "https://github.com/OCA/mail", + "author": "SDi, David Juaneda, Sodexis, ACSONE SA/NV," + " Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": ["calendar", "spreadsheet_dashboard"], + "data": ["security/groups.xml", "views/mail_activity_view.xml"], + "assets": { + "web.assets_backend": [ + "mail_activity_board/static/src/components/chatter/chatter.esm.js", + "mail_activity_board/static/src/components/chatter/chatter.xml", + ], + }, +} diff --git a/mail_activity_board/i18n/ca.po b/mail_activity_board/i18n/ca.po new file mode 100644 index 00000000..7cdb0f24 --- /dev/null +++ b/mail_activity_board/i18n/ca.po @@ -0,0 +1,133 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-07-25 17:06+0000\n" +"Last-Translator: jabelchi \n" +"Language-Team: none\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "Act. pròxims 6 mesos" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "Act. mes pròxim" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "Activitats" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "Activitat" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "Formulari d'activitat" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "Assistents" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "Document" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "Durada" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "Enregistra una nota..." + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "Orígen" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "Mostrar activitats programades pels propers 6 mesos." + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "Mostrar activitats programades pel pròxim mes." + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "Inici" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "" +"Data inicial d'un esdeveniment, sense hora per a esdeveniments de tot el dia" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "Comença reunió" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "Usuari" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "" diff --git a/mail_activity_board/i18n/es.po b/mail_activity_board/i18n/es.po new file mode 100644 index 00000000..c566a0a5 --- /dev/null +++ b/mail_activity_board/i18n/es.po @@ -0,0 +1,134 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-05 11:10+0000\n" +"PO-Revision-Date: 2023-09-03 13:36+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "Act. próximos 6 meses" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "Act. próximo mes" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "Actividades" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "Actividad" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "Formulario de actividad" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "Mezclador de actividades" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "Asistentes" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "Documento" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "Duración" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "Registrar una nota..." + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "Origen" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "Mostrar las actividades programadas para los próximos 6 meses." + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "Mostrar las actividades programadas para el próximo mes." + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "Mostrar el tablero de actividades" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "Inicio" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "" +"Fecha de inicio de un evento, sin tiempo para eventos de días completos" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "Empezar reunión" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "Usuario" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "Ver actividades" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "Ej. Discutir propuesta" diff --git a/mail_activity_board/i18n/fr.po b/mail_activity_board/i18n/fr.po new file mode 100644 index 00000000..d289b65d --- /dev/null +++ b/mail_activity_board/i18n/fr.po @@ -0,0 +1,134 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-28 08:10+0000\n" +"Last-Translator: Houzéfa Abbasbhay \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "Act. 6 mois suivants" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "Act. mois suivant" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "Activités" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "Activité" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "Activité - Formulaire" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "Activité - Mixin" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "Participants" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "Document" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "Durée" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "Enregistrer une note..." + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "Origine" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "Afficher les activités prévues dans les 6 mois suivants." + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "Afficher les activités prévues dans le mois suivant." + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "Accès au tableau des activités" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "Début" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "" +"Date de début d'un événement, sans heure pour les événements durant toute la " +"journée" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "Début du rendez-vous" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "Utilisateur" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "par ex. Proposition d'examen" diff --git a/mail_activity_board/i18n/fr_BE.po b/mail_activity_board/i18n/fr_BE.po new file mode 100644 index 00000000..d096d1dc --- /dev/null +++ b/mail_activity_board/i18n/fr_BE.po @@ -0,0 +1,137 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-01-28 11:55+0000\n" +"Last-Translator: Laurent Corron \n" +"Language-Team: none\n" +"Language: fr_BE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "Act. les 6 prochains mois" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "Act. le mois prochain" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "Activités" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "Activité" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "Formulaire d'activité" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "Combinaison d'activités" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "Participants" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "Durée" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "Enregistrer une note ..." + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "Origine" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "Afficher les activités prévues pour les 6 prochains mois." + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "Afficher les activités prévues pour le mois prochain." + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "Début" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "" +"Date de début d'un événement, sans heure pour les événements d'une journée " +"complète" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "Commencer la réunion" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "Utilisateur" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "Par exemple. Discuter de la proposition" + +#~ msgid "See activities list" +#~ msgstr "Voir la liste des activités" diff --git a/mail_activity_board/i18n/it.po b/mail_activity_board/i18n/it.po new file mode 100644 index 00000000..d5375ee9 --- /dev/null +++ b/mail_activity_board/i18n/it.po @@ -0,0 +1,133 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-07-09 09:58+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "Att. prossimi 6 mesi" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "Att. prossimo mese" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "Attività" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "Attività" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "Scheda attività" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "Mixin attività" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "Partecipanti" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "Documento" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "Durata" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "Registra una nota..." + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "Origine" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "Mostra le attività programmate per i prossimi 6 mesi." + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "Mostra le attività programmate per il prossimo mese." + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "Mostra lavagna attività e-mail" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "Avvio" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "" +"Data di inizio di un evento, senza orario per gli eventi a giornata intera" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "Inizio riunione" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "Utente" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "Vedi attività" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "es. proposta discussione" diff --git a/mail_activity_board/i18n/mail_activity_board.pot b/mail_activity_board/i18n/mail_activity_board.pot new file mode 100644 index 00000000..07f68cb8 --- /dev/null +++ b/mail_activity_board/i18n/mail_activity_board.pot @@ -0,0 +1,129 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "" + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "" diff --git a/mail_activity_board/i18n/pt.po b/mail_activity_board/i18n/pt.po new file mode 100644 index 00000000..c5f70edc --- /dev/null +++ b/mail_activity_board/i18n/pt.po @@ -0,0 +1,132 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_activity_board +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-08-30 14:06+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_kanban +msgid "" +msgstr "" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next 6 months" +msgstr "Ativ. próximos 6 meses" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Act. next month" +msgstr "Ativ. no próximo mês" + +#. module: mail_activity_board +#: model:ir.actions.act_window,name:mail_activity_board.open_boards_activities +#: model:ir.ui.menu,name:mail_activity_board.board_menu_activities +msgid "Activities" +msgstr "Atividades" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity" +msgstr "Atividade" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Activity Form" +msgstr "Formulário de Atividade" + +#. module: mail_activity_board +#: model:ir.model,name:mail_activity_board.model_mail_activity_mixin +msgid "Activity Mixin" +msgstr "Mixin de Atividades" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_partner_ids +msgid "Attendees" +msgstr "Participantes" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__related_model_instance +msgid "Document" +msgstr "Documento" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__duration +msgid "Duration" +msgstr "Duração" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Log a note..." +msgstr "Incluir uma nota..." + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__res_model_id_name +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Origin" +msgstr "Origem" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next 6 months." +msgstr "Mostrar atividades programadas para os próximos 6 meses." + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "Show activities scheduled for next month." +msgstr "Mostrar atividades programadas para o próximo mês." + +#. module: mail_activity_board +#: model:res.groups,name:mail_activity_board.group_show_mail_activity_board +msgid "Show mail activity board" +msgstr "Mostrar quadro de atividades de e-mail" + +#. module: mail_activity_board +#: model:ir.model.fields,field_description:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start" +msgstr "Iniciar" + +#. module: mail_activity_board +#: model:ir.model.fields,help:mail_activity_board.field_mail_activity__calendar_event_id_start +msgid "Start date of an event, without time for full days events" +msgstr "Data de início de um evento, sem tempo para eventos de dia inteiro" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "Start meeting" +msgstr "Iniciar reunião" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_search +msgid "User" +msgstr "Utilizador" + +#. module: mail_activity_board +#. odoo-javascript +#: code:addons/mail_activity_board/static/src/components/chatter/chatter.xml:0 +#, python-format +msgid "View Activities" +msgstr "Ver Atividades" + +#. module: mail_activity_board +#: model_terms:ir.ui.view,arch_db:mail_activity_board.mail_activity_view_form_board +msgid "e.g. Discuss proposal" +msgstr "ex. Discussão de proposta" diff --git a/mail_activity_board/models/__init__.py b/mail_activity_board/models/__init__.py new file mode 100644 index 00000000..caf9c18d --- /dev/null +++ b/mail_activity_board/models/__init__.py @@ -0,0 +1,2 @@ +from . import mail_activity +from . import mail_activity_mixin diff --git a/mail_activity_board/models/mail_activity.py b/mail_activity_board/models/mail_activity.py new file mode 100644 index 00000000..fba9dc0e --- /dev/null +++ b/mail_activity_board/models/mail_activity.py @@ -0,0 +1,74 @@ +# Copyright 2018 David Juaneda - +# Copyright 2018 ForgeFlow S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class MailActivity(models.Model): + _inherit = "mail.activity" + + res_model_id_name = fields.Char( + related="res_model_id.name", string="Origin", readonly=True + ) + duration = fields.Float(related="calendar_event_id.duration", readonly=True) + calendar_event_id_start = fields.Datetime( + related="calendar_event_id.start", readonly=True + ) + calendar_event_id_partner_ids = fields.Many2many( + related="calendar_event_id.partner_ids", readonly=True + ) + related_model_instance = fields.Reference( + selection="_selection_related_model_instance", + compute="_compute_related_model_instance", + string="Document", + ) + user_avatar_128 = fields.Binary(related="user_id.avatar_128", readonly=True) + + @api.depends("res_id", "res_model") + def _compute_related_model_instance(self): + for record in self: + ref = False + if record.res_id: + ref = f"{record.res_model},{record.res_id}" + record.related_model_instance = ref + + @api.model + def _selection_related_model_instance(self): + models = self.env["ir.model"].sudo().search([("is_mail_activity", "=", True)]) + return [(model.model, model.name) for model in models] + + def open_origin(self): + self.ensure_one() + vid = self.env[self.res_model].browse(self.res_id).get_formview_id() + response = { + "type": "ir.actions.act_window", + "res_model": self.res_model, + "view_mode": "form", + "res_id": self.res_id, + "target": "current", + "flags": {"form": {"action_buttons": False}}, + "views": [(vid, "form")], + } + return response + + @api.model + def action_activities_board(self): + action = self.env["ir.actions.act_window"]._for_xml_id( + "mail_activity_board.open_boards_activities" + ) + return action + + @api.model + def _find_allowed_model_wise(self, doc_model, doc_dict): + doc_ids = list(doc_dict) + allowed_doc_ids = ( + self.env[doc_model] + .with_context(active_test=False) + .search([("id", "in", doc_ids)]) + .ids + ) + return { + message_id + for allowed_doc_id in allowed_doc_ids + for message_id in doc_dict[allowed_doc_id] + } diff --git a/mail_activity_board/models/mail_activity_mixin.py b/mail_activity_board/models/mail_activity_mixin.py new file mode 100644 index 00000000..2f526e43 --- /dev/null +++ b/mail_activity_board/models/mail_activity_mixin.py @@ -0,0 +1,34 @@ +# Copyright 2018 David Juaneda - +# Copyright 2021 Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class MailActivityMixin(models.AbstractModel): + _inherit = "mail.activity.mixin" + + def redirect_to_activities(self, **kwargs): + """Redirects to the list of activities of the object shown. + + Redirects to the activity board and configures the domain so that + only those activities that are related to the object shown are + displayed. + + Add to the title of the view the name the class of the object from + which the activities will be displayed. + + :param kwargs: contains the id of the object and the model it's about. + + :return: action. + """ + _id = kwargs.get("id") + model = kwargs.get("model") + action = self.env["mail.activity"].action_activities_board() + views = [] + for v in action["views"]: + if v[1] == "tree": + v = (v[0], "list") + views.append(v) + action["views"] = views + action["domain"] = [("res_id", "=", _id), (("res_model", "=", model))] + return action diff --git a/mail_activity_board/pyproject.toml b/mail_activity_board/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/mail_activity_board/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_activity_board/readme/CONTRIBUTORS.md b/mail_activity_board/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..a7c1444e --- /dev/null +++ b/mail_activity_board/readme/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +- [SDI](https://www.sdi.es): + - David Juaneda +- [ForgeFlow](https://www.forgeflow.com): + - Miquel Raïch () +- [Pesol](https://www.pesol.es): + - Pedro Gonzalez () +- [ACSONE SA/NV](https://www.acsone.eu) + - Laurent Mignon \<\> diff --git a/mail_activity_board/readme/DESCRIPTION.md b/mail_activity_board/readme/DESCRIPTION.md new file mode 100644 index 00000000..4676294f --- /dev/null +++ b/mail_activity_board/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module adds an activity board with form, tree, kanban, calendar, +pivot, graph and search views. diff --git a/mail_activity_board/readme/USAGE.md b/mail_activity_board/readme/USAGE.md new file mode 100644 index 00000000..30fb22bd --- /dev/null +++ b/mail_activity_board/readme/USAGE.md @@ -0,0 +1,10 @@ +To use this module, you need to: + +1. Access to the views from menu Boards. + +A smartButton of activities is added in the mail thread from form view. +From this smartButton is linked to the activity board, to the view tree, +which shows the activities related to the opportunity. + +From the form view of the activity you can navigate to the origin of the +activity. diff --git a/mail_activity_board/security/groups.xml b/mail_activity_board/security/groups.xml new file mode 100644 index 00000000..7f053c49 --- /dev/null +++ b/mail_activity_board/security/groups.xml @@ -0,0 +1,10 @@ + + + + Show mail activity board + + + diff --git a/mail_activity_board/static/description/icon.png b/mail_activity_board/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/mail_activity_board/static/description/icon.png differ diff --git a/mail_activity_board/static/description/index.html b/mail_activity_board/static/description/index.html new file mode 100644 index 00000000..177c267c --- /dev/null +++ b/mail_activity_board/static/description/index.html @@ -0,0 +1,455 @@ + + + + + +Mail Activity Board + + + +
+

Mail Activity Board

+ + +

Beta License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

This module adds an activity board with form, tree, kanban, calendar, +pivot, graph and search views.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Access to the views from menu Boards.
  2. +
+

A smartButton of activities is added in the mail thread from form view. +From this smartButton is linked to the activity board, to the view tree, +which shows the activities related to the opportunity.

+

From the form view of the activity you can navigate to the origin of the +activity.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • SDi
  • +
  • David Juaneda
  • +
  • Sodexis
  • +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/mail project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mail_activity_board/static/src/components/chatter/chatter.esm.js b/mail_activity_board/static/src/components/chatter/chatter.esm.js new file mode 100644 index 00000000..7f3f5259 --- /dev/null +++ b/mail_activity_board/static/src/components/chatter/chatter.esm.js @@ -0,0 +1,34 @@ +import {Chatter} from "@mail/chatter/web_portal/chatter"; +import {patch} from "@web/core/utils/patch"; + +patch(Chatter.prototype, { + // -------------------------------------------------------------------------- + // Handlers + // -------------------------------------------------------------------------- + + /** + * @private + * @param {MouseEvent} ev + */ + // eslint-disable-next-line no-unused-vars + async _onListActivity(ev) { + if (this.state.thread) { + const thread = this.state.thread; + const action = await this.orm.call( + thread.model, + "redirect_to_activities", + [[]], + { + id: this.state.thread.id, + model: this.state.thread.model, + } + ); + this.action.doAction(action, { + onClose: () => { + thread.refreshActivities(); + thread.refresh(); + }, + }); + } + }, +}); diff --git a/mail_activity_board/static/src/components/chatter/chatter.xml b/mail_activity_board/static/src/components/chatter/chatter.xml new file mode 100644 index 00000000..e1b06177 --- /dev/null +++ b/mail_activity_board/static/src/components/chatter/chatter.xml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/mail_activity_board/tests/__init__.py b/mail_activity_board/tests/__init__.py new file mode 100644 index 00000000..a87cb6e9 --- /dev/null +++ b/mail_activity_board/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mail_activity_board diff --git a/mail_activity_board/tests/test_mail_activity_board.py b/mail_activity_board/tests/test_mail_activity_board.py new file mode 100644 index 00000000..dea747f2 --- /dev/null +++ b/mail_activity_board/tests/test_mail_activity_board.py @@ -0,0 +1,216 @@ +# Copyright 2018 David Juaneda - +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo.tests.common import TransactionCase + + +class TestMailActivityBoardMethods(TransactionCase): + def setUp(self): + super().setUp() + # Set up activities + + # Create a user as 'Crm Salesman' and added few groups + mail_activity_group = self.create_mail_activity_group() + self.employee = self.env["res.users"].create( + { + "company_id": self.env.ref("base.main_company").id, + "name": "Employee", + "login": "csu", + "email": "crmuser@yourcompany.com", + "groups_id": [ + ( + 6, + 0, + [ + self.env.ref("base.group_user").id, + ], + ) + ], + } + ) + + # Create a user who doesn't have access to anything except activities + + self.employee2 = self.env["res.users"].create( + { + "company_id": self.env.ref("base.main_company").id, + "name": "Employee2", + "login": "alien", + "email": "alien@yourcompany.com", + "groups_id": [(6, 0, [mail_activity_group.id])], + } + ) + + # lead_model_id = self.env['ir.model']._get('crm.lead').id + partner_model = self.env["ir.model"]._get("res.partner") + + ActivityType = self.env["mail.activity.type"] + self.activity1 = ActivityType.create( + { + "name": "Initial Contact", + "delay_count": 5, + "delay_unit": "days", + "summary": "ACT 1 : Presentation, barbecue, ... ", + "res_model": partner_model.model, + } + ) + self.activity2 = ActivityType.create( + { + "name": "Call for Demo", + "delay_count": 6, + "delay_unit": "days", + "summary": "ACT 2 : I want to show you my ERP !", + "res_model": partner_model.model, + } + ) + self.activity3 = ActivityType.create( + { + "name": "Celebrate the sale", + "delay_count": 3, + "delay_unit": "days", + "summary": "ACT 3 : " + "Beers for everyone because I am a good salesman !", + "res_model": partner_model.model, + } + ) + + # I create an opportunity, as employee + self.partner_client = self.env.ref("base.res_partner_1") + + # assure there isn't any mail activity yet + self.env["mail.activity"].sudo().search([]).unlink() + + self.act1 = ( + self.env["mail.activity"] + .sudo() + .create( + { + "activity_type_id": self.activity3.id, + "note": "Partner activity 1.", + "res_id": self.partner_client.id, + "res_model_id": partner_model.id, + "user_id": self.employee.id, + } + ) + ) + self.act2 = ( + self.env["mail.activity"] + .sudo() + .create( + { + "activity_type_id": self.activity2.id, + "note": "Partner activity 2.", + "res_id": self.partner_client.id, + "res_model_id": partner_model.id, + "user_id": self.employee.id, + } + ) + ) + self.act3 = ( + self.env["mail.activity"] + .sudo() + .create( + { + "activity_type_id": self.activity3.id, + "note": "Partner activity 3.", + "res_id": self.partner_client.id, + "res_model_id": partner_model.id, + "user_id": self.employee.id, + } + ) + ) + + def create_mail_activity_group(self): + manager_mail_activity_test_group = self.env["res.groups"].create( + {"name": "group_manager_mail_activity_test"} + ) + mail_activity_model_id = ( + self.env["ir.model"] + .sudo() + .search([("model", "=", "mail.activity")], limit=1) + ) + access = self.env["ir.model.access"].create( + { + "name": "full_access_mail_activity", + "model_id": mail_activity_model_id.id, + "perm_read": True, + "perm_write": True, + "perm_create": True, + "perm_unlink": True, + } + ) + access.group_id = manager_mail_activity_test_group + return manager_mail_activity_test_group + + def get_view(self, activity): + action = activity.open_origin() + result = self.env[action.get("res_model")].get_views(action.get("views")) + return result.get("views").get(action.get("view_mode")) + + def test_open_origin_res_partner(self): + """This test case checks + - If the method redirects to the form view of the correct one + of an object of the 'res.partner' class to which the activity + belongs. + """ + # Id of the form view for the class 'crm.lead', type 'lead' + form_view_partner_id = self.env.ref("base.view_partner_form").id + + # Id of the form view return open_origin() + view = self.get_view(self.act1) + + # Check the next view is correct + self.assertEqual(form_view_partner_id, view.get("id")) + + # Id of the form view return open_origin() + view = self.get_view(self.act2) + + # Check the next view is correct + self.assertEqual(form_view_partner_id, view.get("id")) + + # Id of the form view return open_origin() + view = self.get_view(self.act3) + + # Check the next view is correct + self.assertEqual(form_view_partner_id, view.get("id")) + + def test_redirect_to_activities(self): + """This test case checks + - if the method returns the correct action, + - if the correct activities are shown. + """ + action_id = self.env.ref("mail_activity_board.open_boards_activities").id + action = self.partner_client.redirect_to_activities( + **{ + "id": self.partner_client.id, + "model": self.partner_client._name, + } + ) + self.assertEqual(action.get("id"), action_id) + + kwargs = {"groupby": ["activity_type_id"]} + kwargs["domain"] = action.get("domain") + + result = self.env[action.get("res_model")].get_views(action.get("views")) + # fields = result.get("views").get("kanban").get("fields") + fields = result.get("models").get(action.get("res_model")) + kwargs["fields"] = list(fields["fields"].keys()) + + result = self.env["mail.activity"].read_group(**kwargs) + + acts = [] + for group in result: + records = self.env["mail.activity"].search_read( + domain=group.get("__domain"), fields=kwargs["fields"] + ) + acts += [record_id.get("id") for record_id in records] + + for act in acts: + self.assertIn(act, self.partner_client.activity_ids.ids) + + def test_related_model_instance(self): + """This test case checks the direct access from the activity to the + linked model instance + """ + self.assertEqual(self.act3.related_model_instance, self.partner_client) + self.act3.write({"res_id": False, "res_model": False}) + self.assertFalse(self.act3.related_model_instance) diff --git a/mail_activity_board/views/mail_activity_view.xml b/mail_activity_board/views/mail_activity_view.xml new file mode 100644 index 00000000..dd198b78 --- /dev/null +++ b/mail_activity_board/views/mail_activity_view.xml @@ -0,0 +1,324 @@ + + + + + + + mail.activity.view.form.popup (in mail_activity_board) + + mail.activity + + + + + + + + + + + mail.activity.view.form.calendar (in mail_activity_board) + + mail.activity + + + + + + + 1 + + + + + + + mail.activity.boards.view.form + mail.activity + 30 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + mail.activity.boards.view.tree + mail.activity + + + + + (date_deadline < current_date) + (date_deadline == current_date) + (date_deadline > current_date) + + + + + + 1 + + + + + + + mail.activity.boards.view.kanban + mail.activity + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+
+
+
+
+
+
+
+ + + + mail.activity.boards.view.search + mail.activity + + + primary + + + + + + + + + + + + + + + + + + + + + + Activities + mail.activity + kanban,form + [] + {} + + + + + + +
diff --git a/mail_notification_with_history/README.rst b/mail_notification_with_history/README.rst new file mode 100644 index 00000000..ba79f92a --- /dev/null +++ b/mail_notification_with_history/README.rst @@ -0,0 +1,104 @@ +============================== +Mail Notification With History +============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:758c6aa38b53fe83b11dd396bdd24dc7ed5e52fc91d34f93fb45709e899fc543 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/18.0/mail_notification_with_history + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_notification_with_history + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Followers of a discussion in the chatter of Odoo can be informed by +email of a new message being created. This module adds in that email the +history of the chatter discussion to help the recipient with more +context. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +After installing the module its behaviour needs to be activated. This is +done by setting the following class variable +\_mail_notification_include_history to True, on the model that we would +like to activate it. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- `Camptocamp `__ + + - Thierry Ducrest + - Tris Doan + +Other credits +------------- + +The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp. + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-TDu| image:: https://github.com/TDu.png?size=40px + :target: https://github.com/TDu + :alt: TDu + +Current `maintainer `__: + +|maintainer-TDu| + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_notification_with_history/__init__.py b/mail_notification_with_history/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/mail_notification_with_history/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_notification_with_history/__manifest__.py b/mail_notification_with_history/__manifest__.py new file mode 100644 index 00000000..eef0d659 --- /dev/null +++ b/mail_notification_with_history/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +{ + "name": "Mail Notification With History", + "summary": """Add the previous chatter discussion into new email notifications.""", + "version": "18.0.1.0.0", + "category": "Social Network", + "website": "https://github.com/OCA/mail", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": ["mail"], + "data": ["data/mail_data.xml"], + "development_status": "Beta", + "maintainers": ["TDu"], +} diff --git a/mail_notification_with_history/data/mail_data.xml b/mail_notification_with_history/data/mail_data.xml new file mode 100644 index 00000000..5a7fd721 --- /dev/null +++ b/mail_notification_with_history/data/mail_data.xml @@ -0,0 +1,27 @@ + + + + diff --git a/mail_notification_with_history/i18n/es.po b/mail_notification_with_history/i18n/es.po new file mode 100644 index 00000000..bc0e298c --- /dev/null +++ b/mail_notification_with_history/i18n/es.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_notification_with_history +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-28 11:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mail_notification_with_history +#: model_terms:ir.ui.view,arch_db:mail_notification_with_history.mail_notification_layout +msgid "Discussion history in Odoo:" +msgstr "Historial de discusiones en Odoo:" + +#. module: mail_notification_with_history +#: model:ir.model,name:mail_notification_with_history.model_mail_thread +msgid "Email Thread" +msgstr "Hilo de Correo Electrónico" + +#. module: mail_notification_with_history +#: model:ir.model,name:mail_notification_with_history.model_mail_message +msgid "Message" +msgstr "Mensaje" + +#. module: mail_notification_with_history +#: model_terms:ir.ui.view,arch_db:mail_notification_with_history.mail_notification_layout +msgid "commented on" +msgstr "comentado en" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/mail_notification_with_history/i18n/it.po b/mail_notification_with_history/i18n/it.po new file mode 100644 index 00000000..54cab6d9 --- /dev/null +++ b/mail_notification_with_history/i18n/it.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_notification_with_history +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-11-05 11:06+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: mail_notification_with_history +#: model_terms:ir.ui.view,arch_db:mail_notification_with_history.mail_notification_layout +msgid "Discussion history in Odoo:" +msgstr "Cronologia discussione in Odoo:" + +#. module: mail_notification_with_history +#: model:ir.model,name:mail_notification_with_history.model_mail_thread +msgid "Email Thread" +msgstr "Discussione e-mail" + +#. module: mail_notification_with_history +#: model:ir.model,name:mail_notification_with_history.model_mail_message +msgid "Message" +msgstr "Messaggio" + +#. module: mail_notification_with_history +#: model_terms:ir.ui.view,arch_db:mail_notification_with_history.mail_notification_layout +msgid "commented on" +msgstr "commentato in" diff --git a/mail_notification_with_history/i18n/mail_notification_with_history.pot b/mail_notification_with_history/i18n/mail_notification_with_history.pot new file mode 100644 index 00000000..6769afbd --- /dev/null +++ b/mail_notification_with_history/i18n/mail_notification_with_history.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_notification_with_history +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_notification_with_history +#: model_terms:ir.ui.view,arch_db:mail_notification_with_history.mail_notification_layout +msgid "Discussion history in Odoo:" +msgstr "" + +#. module: mail_notification_with_history +#: model:ir.model,name:mail_notification_with_history.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: mail_notification_with_history +#: model:ir.model,name:mail_notification_with_history.model_mail_message +msgid "Message" +msgstr "" + +#. module: mail_notification_with_history +#: model_terms:ir.ui.view,arch_db:mail_notification_with_history.mail_notification_layout +msgid "commented on" +msgstr "" diff --git a/mail_notification_with_history/models/__init__.py b/mail_notification_with_history/models/__init__.py new file mode 100644 index 00000000..eccc2881 --- /dev/null +++ b/mail_notification_with_history/models/__init__.py @@ -0,0 +1,2 @@ +from . import mail_message +from . import mail_thread diff --git a/mail_notification_with_history/models/mail_message.py b/mail_notification_with_history/models/mail_message.py new file mode 100644 index 00000000..a97cd943 --- /dev/null +++ b/mail_notification_with_history/models/mail_message.py @@ -0,0 +1,31 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import models + + +class Message(models.Model): + _inherit = "mail.message" + + def _get_notification_message_history(self): + """Get the list of messages to include into an email notification history.""" + if ( + not self.model + or not self.env[self.model]._mail_notification_include_history + ): + return self.browse() + domain = self._get_notification_message_history_domain() + messages = self.env["mail.message"].search(domain, order="date desc") + return messages - self + + def _get_notification_message_history_domain(self): + """Return the domain for email and send message comments.""" + return [ + ("model", "=", self.model), + ("res_id", "=", self.res_id), + "|", + "&", + ("message_type", "=", "comment"), + ("subtype_id", "=", self.env.ref("mail.mt_comment").id), + ("message_type", "=", "email"), + ] diff --git a/mail_notification_with_history/models/mail_thread.py b/mail_notification_with_history/models/mail_thread.py new file mode 100644 index 00000000..e34ea4cc --- /dev/null +++ b/mail_notification_with_history/models/mail_thread.py @@ -0,0 +1,10 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import models + + +class MailThread(models.AbstractModel): + _inherit = "mail.thread" + + _mail_notification_include_history = False diff --git a/mail_notification_with_history/pyproject.toml b/mail_notification_with_history/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/mail_notification_with_history/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_notification_with_history/readme/CONTRIBUTORS.md b/mail_notification_with_history/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..9157c90c --- /dev/null +++ b/mail_notification_with_history/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [Camptocamp](https://www.camptocamp.com) + + > - Thierry Ducrest \<\> + > - Tris Doan \<\> diff --git a/mail_notification_with_history/readme/CREDITS.md b/mail_notification_with_history/readme/CREDITS.md new file mode 100644 index 00000000..573d68b7 --- /dev/null +++ b/mail_notification_with_history/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 14.0 to 18.0 was financially supported by Camptocamp. diff --git a/mail_notification_with_history/readme/DESCRIPTION.md b/mail_notification_with_history/readme/DESCRIPTION.md new file mode 100644 index 00000000..55e0a1f6 --- /dev/null +++ b/mail_notification_with_history/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +Followers of a discussion in the chatter of Odoo can be informed by +email of a new message being created. This module adds in that email the +history of the chatter discussion to help the recipient with more +context. diff --git a/mail_notification_with_history/readme/INSTALL.md b/mail_notification_with_history/readme/INSTALL.md new file mode 100644 index 00000000..526cf7c9 --- /dev/null +++ b/mail_notification_with_history/readme/INSTALL.md @@ -0,0 +1,4 @@ +After installing the module its behaviour needs to be activated. This is +done by setting the following class variable +\_mail_notification_include_history to True, on the model that we would +like to activate it. diff --git a/mail_notification_with_history/static/description/icon.png b/mail_notification_with_history/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/mail_notification_with_history/static/description/icon.png differ diff --git a/mail_notification_with_history/static/description/index.html b/mail_notification_with_history/static/description/index.html new file mode 100644 index 00000000..667a8f03 --- /dev/null +++ b/mail_notification_with_history/static/description/index.html @@ -0,0 +1,449 @@ + + + + + +Mail Notification With History + + + +
+

Mail Notification With History

+ + +

Beta License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

Followers of a discussion in the chatter of Odoo can be informed by +email of a new message being created. This module adds in that email the +history of the chatter discussion to help the recipient with more +context.

+

Table of contents

+ +
+

Installation

+

After installing the module its behaviour needs to be activated. This is +done by setting the following class variable +_mail_notification_include_history to True, on the model that we would +like to activate it.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp.

+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

TDu

+

This module is part of the OCA/mail project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mail_notification_with_history/tests/__init__.py b/mail_notification_with_history/tests/__init__.py new file mode 100644 index 00000000..acd85eb7 --- /dev/null +++ b/mail_notification_with_history/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mail_notification_with_history diff --git a/mail_notification_with_history/tests/test_mail_notification_with_history.py b/mail_notification_with_history/tests/test_mail_notification_with_history.py new file mode 100644 index 00000000..76aa229c --- /dev/null +++ b/mail_notification_with_history/tests/test_mail_notification_with_history.py @@ -0,0 +1,89 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from unittest.mock import Mock, patch + +from odoo.addons.base.tests.common import SavepointCaseWithUserDemo + + +class TestMailNotificationWithHistory(SavepointCaseWithUserDemo): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.base_template = cls.env.ref("mail.mail_notification_layout") + cls.mail_message = cls.env.ref("mail.mail_message_channel_1_2_1") + cls.message_subtype = cls.env.ref("mail.mt_comment") + cls.render_values = { + "button_access": {"title": "View Record", "url": "http://127.0.0.1"}, + "actions": [], + "company": cls.env.company, + "has_button_access": True, + "is_discussion": True, + "lang": "en_US", + "message": cls.mail_message, + "subtype": cls.message_subtype, + } + + def test_thread_history_is_included(self): + with patch( + ( + "odoo.addons.mail_notification_with_history.models.mail_thread." + "MailThread._mail_notification_include_history" + ), + new=Mock(return_value=True), + ): + body = self.env["ir.qweb"]._render( + "mail.mail_notification_layout", + self.render_values, + minimal_qcontext=True, + ) + self.assertTrue(body.find("Discussion") >= 0) + + def test_thread_history_is_not_included(self): + body = self.env["ir.qweb"]._render( + "mail.mail_notification_layout", + self.render_values, + minimal_qcontext=True, + ) + self.assertTrue(body.find("Discussion") == -1) + + def test_domain_message_in_history(self): + """Check the good number of message is returned for the history.""" + # There is already two messages from demo data and we create... + # One email message that should be included + self.env["mail.message"].create( + { + "message_type": "email", + "model": self.mail_message.model, + "res_id": self.mail_message.res_id, + } + ) + # One comment (message) should be included + self.env["mail.message"].create( + { + "message_type": "comment", + "model": self.mail_message.model, + "res_id": self.mail_message.res_id, + "subtype_id": self.env.ref("mail.mt_comment").id, + } + ) + # One comment (internal note) should NOT be included + self.env["mail.message"].create( + { + "message_type": "comment", + "model": self.mail_message.model, + "res_id": self.mail_message.res_id, + "subtype_id": self.env.ref("mail.mt_note").id, + } + ) + with patch( + ( + "odoo.addons.mail_notification_with_history.models.mail_thread." + "MailThread._mail_notification_include_history" + ), + new=Mock(return_value=True), + ): + history = self.mail_message._get_notification_message_history() + # So that is four message to include in history + self.assertEqual(len(history), 4) diff --git a/mail_thread_create_nolog/README.rst b/mail_thread_create_nolog/README.rst new file mode 100644 index 00000000..dede4b3d --- /dev/null +++ b/mail_thread_create_nolog/README.rst @@ -0,0 +1,109 @@ +============================= +Mail Thread - Fake create log +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a76dedae420c3c636ef5042fcd7379e1f2c05a27e4392be737c007b081887ef5 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github + :target: https://github.com/OCA/mail/tree/18.0/mail_thread_create_nolog + :alt: OCA/mail +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_thread_create_nolog + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module will block the creation in the database of 'Record created' +messages on data models inheriting from mail.thread, but will instead +generate this message on the fly when Odoo displays the messages of a +record. + +This allows to reduce the size of the mail_message table. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +- Ability to configure the create_nolog context key by data model + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- `Camptocamp `__: + + - Sébastien Alix + +- Chau Le chaulb@trobz.com + +Other credits +------------- + +The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp. + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-sebalix| image:: https://github.com/sebalix.png?size=40px + :target: https://github.com/sebalix + :alt: sebalix + +Current `maintainer `__: + +|maintainer-sebalix| + +This module is part of the `OCA/mail `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_thread_create_nolog/__init__.py b/mail_thread_create_nolog/__init__.py new file mode 100644 index 00000000..f7209b17 --- /dev/null +++ b/mail_thread_create_nolog/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import controllers diff --git a/mail_thread_create_nolog/__manifest__.py b/mail_thread_create_nolog/__manifest__.py new file mode 100644 index 00000000..5de32685 --- /dev/null +++ b/mail_thread_create_nolog/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +{ + "name": "Mail Thread - Fake create log", + "summary": "Display a fake (non-stored) create log in the chatter.", + "version": "18.0.1.0.0", + "category": "Mail", + "website": "https://github.com/OCA/mail", + "author": "Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["sebalix"], + "development_status": "Alpha", + "license": "AGPL-3", + "installable": True, + "depends": ["mail"], +} diff --git a/mail_thread_create_nolog/controllers/__init__.py b/mail_thread_create_nolog/controllers/__init__.py new file mode 100644 index 00000000..b4f3e603 --- /dev/null +++ b/mail_thread_create_nolog/controllers/__init__.py @@ -0,0 +1 @@ +from . import thread diff --git a/mail_thread_create_nolog/controllers/thread.py b/mail_thread_create_nolog/controllers/thread.py new file mode 100644 index 00000000..6bdad0b7 --- /dev/null +++ b/mail_thread_create_nolog/controllers/thread.py @@ -0,0 +1,37 @@ +from odoo import http +from odoo.http import request + +from odoo.addons.mail.controllers import thread as mail_thread + + +class ThreadController(mail_thread.ThreadController): + @http.route("/mail/thread/messages", methods=["POST"], type="json", auth="user") + def mail_thread_messages( + self, + thread_model, + thread_id, + search_term=None, + before=None, + after=None, + around=None, + limit=30, + ): + result = super().mail_thread_messages( + thread_model, thread_id, search_term, before, after, around, limit + ) + + result["data"].setdefault("mail.message", []) + + domain = [ + ("res_id", "=", int(thread_id)), + ("model", "=", thread_model), + ("message_type", "!=", "user_notification"), + ] + + message = request.env["mail.message"]._generate_messsage(domain) + + if message: + result["data"]["mail.message"].append(message) + result["messages"].append(message["id"]) + + return result diff --git a/mail_thread_create_nolog/i18n/es.po b/mail_thread_create_nolog/i18n/es.po new file mode 100644 index 00000000..d304816c --- /dev/null +++ b/mail_thread_create_nolog/i18n/es.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_thread_create_nolog +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-28 17:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mail_thread_create_nolog +#: model:ir.model,name:mail_thread_create_nolog.model_mail_thread +msgid "Email Thread" +msgstr "Hilo de Correo Electrónico" + +#. module: mail_thread_create_nolog +#: model:ir.model,name:mail_thread_create_nolog.model_mail_message +msgid "Message" +msgstr "Mensaje" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/mail_thread_create_nolog/i18n/it.po b/mail_thread_create_nolog/i18n/it.po new file mode 100644 index 00000000..ba408516 --- /dev/null +++ b/mail_thread_create_nolog/i18n/it.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_thread_create_nolog +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-10-29 12:06+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: mail_thread_create_nolog +#: model:ir.model,name:mail_thread_create_nolog.model_mail_thread +msgid "Email Thread" +msgstr "Discussione e-mail" + +#. module: mail_thread_create_nolog +#: model:ir.model,name:mail_thread_create_nolog.model_mail_message +msgid "Message" +msgstr "Messaggio" diff --git a/mail_thread_create_nolog/i18n/mail_thread_create_nolog.pot b/mail_thread_create_nolog/i18n/mail_thread_create_nolog.pot new file mode 100644 index 00000000..360db417 --- /dev/null +++ b/mail_thread_create_nolog/i18n/mail_thread_create_nolog.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_thread_create_nolog +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_thread_create_nolog +#: model:ir.model,name:mail_thread_create_nolog.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: mail_thread_create_nolog +#: model:ir.model,name:mail_thread_create_nolog.model_mail_message +msgid "Message" +msgstr "" diff --git a/mail_thread_create_nolog/models/__init__.py b/mail_thread_create_nolog/models/__init__.py new file mode 100644 index 00000000..5140e08b --- /dev/null +++ b/mail_thread_create_nolog/models/__init__.py @@ -0,0 +1,2 @@ +from . import mail_thread +from . import mail_message diff --git a/mail_thread_create_nolog/models/mail_message.py b/mail_thread_create_nolog/models/mail_message.py new file mode 100644 index 00000000..4e0ad764 --- /dev/null +++ b/mail_thread_create_nolog/models/mail_message.py @@ -0,0 +1,83 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import api, models + + +class MailMessage(models.AbstractModel): + _inherit = "mail.message" + + def _get_message_fields(self): + return [ + "body", + "date", + "message_type", + "model", + "res_id", + ] + + @api.model + def _generate_messsage(self, domain): + # Generate a creation message only if messages are fetched for a record. + # In that case there is no specific record implied, so no need to generate the + # the message. + record = self._messages_for_record(domain) + author = record.create_uid.partner_id + + if record and record._log_access: + creation_message = record._creation_message() + create_message_record = self.new( + { + "body": creation_message, + "date": record.create_date, + "model": record._name, + "res_id": record.id, + "message_type": "notification", + } + ) + + data = create_message_record._read_format( + self._get_message_fields(), load=False + )[0] + + data.update( + { + # An ID is required by the thread client-side + # so we generate one that doesn't really exist + # but based on the current thread so it'll always be + # unique (used by the thread_cache client model). + "id": self._get_create_message_id(domain), + # Author is not preserved above when creating the fake-record + "author": { + "id": author.id, + "name": author.name, + # 'partner' type will return odoo bot avatar + "type": "partner", + }, + } + ) + + return data + + return None + + def _get_create_message_id(self, domain): + # Odoo JS client needs an ID to manage its cache (thread_cache). + # Return the negative version of the greatest message ID + # of the current record so it's always unique. + return -self.search(domain, limit=1, order="id DESC").id + + @api.model + def _messages_for_record(self, domain): + """Return the record from the domain used in `message_fetch`.""" + model = res_id = None + for part in domain: + if len(part) == 3 and part[0] == "model" and part[1] == "=": + model = part[2] + if len(part) == 3 and part[0] == "res_id" and part[1] == "=": + res_id = part[2] + if model and res_id: + break + if model and res_id: + return self.env[model].browse(res_id).exists() + return self.browse() diff --git a/mail_thread_create_nolog/models/mail_thread.py b/mail_thread_create_nolog/models/mail_thread.py new file mode 100644 index 00000000..303235b9 --- /dev/null +++ b/mail_thread_create_nolog/models/mail_thread.py @@ -0,0 +1,18 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import api, models + + +class MailThread(models.AbstractModel): + _inherit = "mail.thread" + + @api.model_create_multi + def create(self, vals_list): + # Overridden to not create 'Record created' messages that increase + # the size of 'mail_message' table for little value. + # Instead a message will be generated on the fly when the Odoo client + # will retrieve the list of messages for a given record. + return super(MailThread, self.with_context(mail_create_nolog=True)).create( + vals_list + ) diff --git a/mail_thread_create_nolog/pyproject.toml b/mail_thread_create_nolog/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/mail_thread_create_nolog/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_thread_create_nolog/readme/CONTRIBUTORS.md b/mail_thread_create_nolog/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..3c2e1f08 --- /dev/null +++ b/mail_thread_create_nolog/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Camptocamp](https://www.camptocamp.com): + - Sébastien Alix +- Chau Le diff --git a/mail_thread_create_nolog/readme/CREDITS.md b/mail_thread_create_nolog/readme/CREDITS.md new file mode 100644 index 00000000..573d68b7 --- /dev/null +++ b/mail_thread_create_nolog/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 14.0 to 18.0 was financially supported by Camptocamp. diff --git a/mail_thread_create_nolog/readme/DESCRIPTION.md b/mail_thread_create_nolog/readme/DESCRIPTION.md new file mode 100644 index 00000000..b3150a42 --- /dev/null +++ b/mail_thread_create_nolog/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This module will block the creation in the database of 'Record created' +messages on data models inheriting from mail.thread, but will instead +generate this message on the fly when Odoo displays the messages of a +record. + +This allows to reduce the size of the mail_message table. diff --git a/mail_thread_create_nolog/readme/ROADMAP.md b/mail_thread_create_nolog/readme/ROADMAP.md new file mode 100644 index 00000000..41e090ac --- /dev/null +++ b/mail_thread_create_nolog/readme/ROADMAP.md @@ -0,0 +1 @@ +- Ability to configure the create_nolog context key by data model diff --git a/mail_thread_create_nolog/static/description/icon.png b/mail_thread_create_nolog/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/mail_thread_create_nolog/static/description/icon.png differ diff --git a/mail_thread_create_nolog/static/description/index.html b/mail_thread_create_nolog/static/description/index.html new file mode 100644 index 00000000..8e79b358 --- /dev/null +++ b/mail_thread_create_nolog/static/description/index.html @@ -0,0 +1,452 @@ + + + + + +Mail Thread - Fake create log + + + +
+

Mail Thread - Fake create log

+ + +

Alpha License: AGPL-3 OCA/mail Translate me on Weblate Try me on Runboat

+

This module will block the creation in the database of ‘Record created’ +messages on data models inheriting from mail.thread, but will instead +generate this message on the fly when Odoo displays the messages of a +record.

+

This allows to reduce the size of the mail_message table.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Known issues / Roadmap

+
    +
  • Ability to configure the create_nolog context key by data model
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp.

+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

sebalix

+

This module is part of the OCA/mail project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mail_thread_create_nolog/tests/__init__.py b/mail_thread_create_nolog/tests/__init__.py new file mode 100644 index 00000000..1e37dccb --- /dev/null +++ b/mail_thread_create_nolog/tests/__init__.py @@ -0,0 +1 @@ +from . import test_create_nolog diff --git a/mail_thread_create_nolog/tests/test_create_nolog.py b/mail_thread_create_nolog/tests/test_create_nolog.py new file mode 100644 index 00000000..8465c20f --- /dev/null +++ b/mail_thread_create_nolog/tests/test_create_nolog.py @@ -0,0 +1,50 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +import json + +from odoo.tests.common import tagged + +from odoo.addons.base.tests.common import HttpCaseWithUserDemo + + +@tagged("post_install", "-at_install") +class TestMailThreadCreateNoLog(HttpCaseWithUserDemo): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner = cls.env["res.partner"].create({"name": "TEST"}) + cls.message_model = cls.env["mail.message"] + + def test_message_fetch(self): + session = self.authenticate("demo", "demo") + + response = self.url_open( + "/mail/thread/messages", + data=json.dumps( + { + "params": { + "thread_model": self.partner._name, + "thread_id": self.partner.id, + } + } + ), + headers={ + "Content-Type": "application/json", + "Cookie": f"session_id={session.sid};", + }, + ) + + self.assertEqual(response.status_code, 200) + + data = response.json() + + create_msg = data["result"]["data"]["mail.message"][-1] + + # # We get a creation message + self.assertEqual(create_msg["model"], self.partner._name) + self.assertEqual(create_msg["res_id"], self.partner.id) + self.assertEqual(create_msg["author"]["id"], self.env.user.partner_id.id) + self.assertEqual(create_msg["body"], self.partner._creation_message()) + # But it doesn't exist in the DB + self.assertFalse(self.message_model.browse(create_msg["id"]).exists())