From a2bf525223df19ed511bb40a41b36f40f3c19f2d Mon Sep 17 00:00:00 2001 From: eduardoi3Data Date: Fri, 24 Apr 2026 11:08:09 +0200 Subject: [PATCH 1/3] [FIX] mail_tracking: enforce multi-company consistency --- mail_tracking/models/mail_tracking_email.py | 29 ++++++++++++------- .../views/mail_tracking_email_view.xml | 3 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/mail_tracking/models/mail_tracking_email.py b/mail_tracking/models/mail_tracking_email.py index 36c1dcde0..63e36a215 100644 --- a/mail_tracking/models/mail_tracking_email.py +++ b/mail_tracking/models/mail_tracking_email.py @@ -49,6 +49,14 @@ class MailTrackingEmail(models.Model): partner_id = fields.Many2one( string="Partner", comodel_name="res.partner", readonly=True ) + company_id = fields.Many2one( + string="Company", + comodel_name="res.company", + related="mail_message_id.record_company_id", + store=True, + readonly=True, + index=True, + ) recipient = fields.Char(string="Recipient email", readonly=True) recipient_address = fields.Char( string="Recipient email address", @@ -152,12 +160,9 @@ def _search( _check_access() for more details about those rules. """ query = super()._search(domain, offset, limit, order) - if not self.env.is_superuser(): - records = self.browse(query) - allowed_ids = self._get_allowed_ids(records.ids) - return self.browse(allowed_ids)._as_query(order) - - return query + records = self.browse(query) + allowed_ids = self._get_allowed_ids(records.ids) + return self.browse(allowed_ids)._as_query(order) def _make_access_error(self, operation: str) -> AccessError: return AccessError( @@ -234,11 +239,15 @@ def _get_allowed_ids(self, ids): msg_ids, mail_ids, partner_ids = [], [], [] if result: _, msg_ids, mail_ids, partner_ids = zip(*result, strict=True) - msg_ids = ( - self.env["mail.message"] - .search([("id", "in", [x for x in msg_ids if x])]) - .ids + msg_ids = self.env["mail.message"].search( + [("id", "in", [x for x in msg_ids if x])] + ) + active_company_id = self.env.company.id + msg_ids = msg_ids.filtered( + lambda msg: not msg.record_company_id + or msg.record_company_id.id == active_company_id ) + msg_ids = msg_ids.ids # Only users from group_system can read mail.mail if self.env.user.has_group("base.group_system"): mail_ids = ( diff --git a/mail_tracking/views/mail_tracking_email_view.xml b/mail_tracking/views/mail_tracking_email_view.xml index 3a417a1af..117687dec 100644 --- a/mail_tracking/views/mail_tracking_email_view.xml +++ b/mail_tracking/views/mail_tracking_email_view.xml @@ -83,7 +83,8 @@ decoration-info="state == 'unsub'" > - + + From 968e3b21952355632d3c5096eab972eabb85c5ce Mon Sep 17 00:00:00 2001 From: eduardoi3Data Date: Tue, 5 May 2026 11:52:02 +0200 Subject: [PATCH 2/3] fix issue with test accepted --- mail_forward/static/tests/tours/mail_forward.esm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_forward/static/tests/tours/mail_forward.esm.js b/mail_forward/static/tests/tours/mail_forward.esm.js index b344c0bf0..ff689850f 100644 --- a/mail_forward/static/tests/tours/mail_forward.esm.js +++ b/mail_forward/static/tests/tours/mail_forward.esm.js @@ -26,7 +26,7 @@ const contact_steps = [ }, { content: "Open contact", - trigger: ".o_list_table td[name='complete_name']:contains('Test Forward')", + trigger: ".o_list_table tr.o_data_row:has(td:contains('Test Forward')) td:contains('Test Forward')", run: "click", }, ]; From ee213fb3f4c514774c4d4f6d431f169714b78f6b Mon Sep 17 00:00:00 2001 From: eduardoi3Data Date: Tue, 5 May 2026 12:04:37 +0200 Subject: [PATCH 3/3] Apply pre-commit fixes --- base_search_mail_content/README.rst | 6 +--- .../static/description/index.html | 30 ++++++++----------- mail_activity_board/README.rst | 6 +--- .../static/description/index.html | 26 +++++++--------- mail_activity_dashboard/README.rst | 6 +--- .../static/description/index.html | 24 ++++++--------- mail_activity_reminder/README.rst | 6 +--- .../static/tests/tours/mail_forward.esm.js | 3 +- 8 files changed, 37 insertions(+), 70 deletions(-) diff --git a/base_search_mail_content/README.rst b/base_search_mail_content/README.rst index 374955958..b52423b0c 100644 --- a/base_search_mail_content/README.rst +++ b/base_search_mail_content/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 - ======================== Base Search Mail Content ======================== @@ -17,7 +13,7 @@ Base Search Mail Content .. |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%2Fmail-lightgray.png?logo=github diff --git a/base_search_mail_content/static/description/index.html b/base_search_mail_content/static/description/index.html index 76526c313..e920f2e46 100644 --- a/base_search_mail_content/static/description/index.html +++ b/base_search_mail_content/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Base Search Mail Content -
+
+

Base Search Mail Content

- - -Odoo Community Association - -
-

Base Search Mail Content

-

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

+

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

This module adds the capability to find on any object (e.g. project issues or helpdesk ticket) based on the conversation threads associated to them.

@@ -407,17 +402,17 @@

Base Search Mail Content

-

Installation

+

Installation

This module creates the GIN (trigram) indexes for these fields of mail.message: subject, body, record_name, email_from, reply_to.

-

Usage

+

Usage

Go to any model that contains a chatter (e.g. Contacts, …). Search for content in field ‘Message Content’.

-

Known issues / Roadmap

+

Known issues / Roadmap

  • This module restricts the message_content search functionality to internal users only, addressing the issue faced by project @@ -431,7 +426,7 @@

    Known issues / Roadmap

-

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 @@ -439,9 +434,9 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • ForgeFlow
  • SerpentCS
  • @@ -449,7 +444,7 @@

    Authors

-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -479,6 +474,5 @@

Maintainers

-
diff --git a/mail_activity_board/README.rst b/mail_activity_board/README.rst index 00c2403b1..607bb63a6 100644 --- a/mail_activity_board/README.rst +++ b/mail_activity_board/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 Activity Board =================== @@ -17,7 +13,7 @@ Mail Activity Board .. |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%2Fmail-lightgray.png?logo=github diff --git a/mail_activity_board/static/description/index.html b/mail_activity_board/static/description/index.html index 75d0ab9b1..15a5121c9 100644 --- a/mail_activity_board/static/description/index.html +++ b/mail_activity_board/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Mail Activity Board -
+
+

Mail Activity Board

- - -Odoo Community Association - -
-

Mail Activity Board

-

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

+

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

@@ -391,7 +386,7 @@

Mail Activity Board

-

Usage

+

Usage

To use this module, you need to:

  1. Access to the views from menu Boards.
  2. @@ -403,7 +398,7 @@

    Usage

    activity.

-

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 @@ -411,9 +406,9 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • SDi
  • David Juaneda
  • @@ -422,7 +417,7 @@

    Authors

-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -460,6 +455,5 @@

Maintainers

-
diff --git a/mail_activity_dashboard/README.rst b/mail_activity_dashboard/README.rst index ce3f9701d..859d72afc 100644 --- a/mail_activity_dashboard/README.rst +++ b/mail_activity_dashboard/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 Activity Dashboard ======================= @@ -17,7 +13,7 @@ Mail Activity Dashboard .. |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%2Fmail-lightgray.png?logo=github diff --git a/mail_activity_dashboard/static/description/index.html b/mail_activity_dashboard/static/description/index.html index d6001579c..3c9763f79 100644 --- a/mail_activity_dashboard/static/description/index.html +++ b/mail_activity_dashboard/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Mail Activity Dashboard -
+
+

Mail Activity Dashboard

- - -Odoo Community Association - -
-

Mail Activity Dashboard

-

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

+

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

This module adds a link to the activity board in the Dashbard menu.

Table of contents

@@ -389,7 +384,7 @@

Mail Activity Dashboard

-

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 @@ -397,9 +392,9 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • SDi
  • David Juaneda
  • @@ -408,7 +403,7 @@

    Authors

-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -446,6 +441,5 @@

Maintainers

-
diff --git a/mail_activity_reminder/README.rst b/mail_activity_reminder/README.rst index 9f3e609b2..925bda743 100644 --- a/mail_activity_reminder/README.rst +++ b/mail_activity_reminder/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 Activity Reminder ====================== @@ -17,7 +13,7 @@ Mail Activity Reminder .. |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%2Fmail-lightgray.png?logo=github diff --git a/mail_forward/static/tests/tours/mail_forward.esm.js b/mail_forward/static/tests/tours/mail_forward.esm.js index ff689850f..ca17ee39f 100644 --- a/mail_forward/static/tests/tours/mail_forward.esm.js +++ b/mail_forward/static/tests/tours/mail_forward.esm.js @@ -26,7 +26,8 @@ const contact_steps = [ }, { content: "Open contact", - trigger: ".o_list_table tr.o_data_row:has(td:contains('Test Forward')) td:contains('Test Forward')", + trigger: + ".o_list_table tr.o_data_row:has(td:contains('Test Forward')) td:contains('Test Forward')", run: "click", }, ];