diff --git a/mail_gateway/README.rst b/mail_gateway/README.rst index c49341aa95..0a45b1e364 100644 --- a/mail_gateway/README.rst +++ b/mail_gateway/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ============ Mail Gateway ============ @@ -17,7 +13,7 @@ Mail Gateway .. |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/license-AGPL--3-blue.png +.. |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%2Fsocial-lightgray.png?logo=github diff --git a/mail_gateway/__manifest__.py b/mail_gateway/__manifest__.py index f2466f51a9..1c8de3ed0a 100644 --- a/mail_gateway/__manifest__.py +++ b/mail_gateway/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Mail Gateway", "summary": "Base module for gateway communications", - "version": "18.0.1.0.8", + "version": "18.0.1.0.9", "license": "AGPL-3", "author": "Creu Blanca,Dixmit,Odoo Community Association (OCA)", "website": "https://github.com/OCA/social", diff --git a/mail_gateway/migrations/18.0.1.0.9/pre-migration.py b/mail_gateway/migrations/18.0.1.0.9/pre-migration.py new file mode 100644 index 0000000000..fa8af9d955 --- /dev/null +++ b/mail_gateway/migrations/18.0.1.0.9/pre-migration.py @@ -0,0 +1,16 @@ +# Copyright 2025 Tecnativa - Carlos Roca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.logged_query( + env.cr, + """ + DELETE FROM mail_notification mn + USING mail_message mm + WHERE mm.gateway_message_id = mn.mail_message_id + AND mn.notification_type != 'gateway'; + """, + ) diff --git a/mail_gateway/models/mail_thread.py b/mail_gateway/models/mail_thread.py index e9dd8182cc..8df8c13c7d 100644 --- a/mail_gateway/models/mail_thread.py +++ b/mail_gateway/models/mail_thread.py @@ -39,6 +39,10 @@ def _notify_thread_by_gateway(self, message, partners_data, **kwargs): ) def _notify_get_recipients(self, message, msg_vals, **kwargs): + if self.env.context.get("link_gateway_message"): + # When we have the context link_gateway_message we want to avoid + # notify the followers thread. + return [] if kwargs.get("gateway_notifications"): result = [] for notification in kwargs["gateway_notifications"]: diff --git a/mail_gateway/static/description/index.html b/mail_gateway/static/description/index.html index a5c726f712..e9522d09f1 100644 --- a/mail_gateway/static/description/index.html +++ b/mail_gateway/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Mail Gateway -
+
+

Mail Gateway

- - -Odoo Community Association - -
-

Mail Gateway

-

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

+

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

This module will allow you to integrate an external chat system in your Odoo system. It requires extra modules with the specific configuration of each chat system, like mail_gateway_telegram or @@ -398,7 +393,7 @@

Mail Gateway

-

Usage

+

Usage

When external messages are received, they will be directly sent to the discuss menu. Answering to these messages will send the answer to the external contact. We can assign this messages to any record using the @@ -411,13 +406,13 @@

Usage

receive messages from gateways.

-

Known issues / Roadmap

+

Known issues / Roadmap

  1. Make possible to schedule gateway messages.
-

Bug Tracker

+

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 @@ -425,16 +420,16 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Creu Blanca
  • Dixmit
-

Contributors

+

Contributors

  • Enric Tobella
  • Olga Marco
  • @@ -446,12 +441,12 @@

    Contributors

-

Other credits

+

Other credits

This work has been funded by AEOdoo (Asociación Española de Odoo - https://www.aeodoo.org)

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -464,6 +459,5 @@

Maintainers

-
diff --git a/mail_gateway/wizards/mail_message_gateway_link.py b/mail_gateway/wizards/mail_message_gateway_link.py index 6ff42bb80b..840b521ea5 100644 --- a/mail_gateway/wizards/mail_message_gateway_link.py +++ b/mail_gateway/wizards/mail_message_gateway_link.py @@ -19,16 +19,16 @@ def _selection_target_model(self): return [(model.model, model.name) for model in models] def link_message(self): - new_message = self.resource_ref.message_post( + new_message = self.resource_ref.with_context( + link_gateway_message=True + ).message_post( body=self.message_id.body, author_id=self.message_id.author_id.id, gateway_type=self.message_id.gateway_type, date=self.message_id.date, - # message_id=update.message.message_id, subtype_xmlid="mail.mt_comment", message_type="comment", attachment_ids=self.message_id.attachment_ids.ids, - gateway_notifications=[], # Avoid sending notifications ) self.message_id.gateway_message_id = new_message self.message_id._bus_send_store(