Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FW] base_search_mail_content: Allow messsage_content search only for internal users #1385

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions base_search_mail_content/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ Usage
Go to any model that contains a chatter (e.g. Contacts, ...). Search for
content in field 'Message Content'.

Known issues / Roadmap
======================

- This module restricts the message_content search functionality to
internal users only, addressing the issue faced by project
collaborators (portal users) as described in
https://github.com/OCA/social/issues/1204. Consequently, portal users
no longer have the ability to search within mail content.

Bug Tracker
===========

Expand Down
6 changes: 5 additions & 1 deletion base_search_mail_content/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def get_view(self, view_id=None, view_type="form", **options):
that inherits mail.thread
"""
res = super().get_view(view_id=view_id, view_type=view_type, options=options)
if view_type == "search" and self._fields.get("message_content"):
if (
view_type == "search"
and self._fields.get("message_content")
and self.env.user.has_group("base.group_user")
):
doc = etree.XML(res["arch"])
for node in doc.xpath("/search/field[last()]"):
# Add message_content in search view
Expand Down
1 change: 1 addition & 0 deletions base_search_mail_content/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- This module restricts the message_content search functionality to internal users only, addressing the issue faced by project collaborators (portal users) as described in <https://github.com/OCA/social/issues/1204>. Consequently, portal users no longer have the ability to search within mail content.
31 changes: 21 additions & 10 deletions base_search_mail_content/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,12 @@ <h1 class="title">Base Search Mail Content</h1>
<ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
</ul>
</li>
</ul>
Expand All @@ -409,26 +410,36 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>Go to any model that contains a chatter (e.g. Contacts, …). Search for
content in field ‘Message Content’.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>This module restricts the message_content search functionality to
internal users only, addressing the issue faced by project
collaborators (portal users) as described in
<a class="reference external" href="https://github.com/OCA/social/issues/1204">https://github.com/OCA/social/issues/1204</a>. Consequently, portal users
no longer have the ability to search within mail content.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20base_search_mail_content%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
<ul class="simple">
<li>ForgeFlow</li>
<li>SerpentCS</li>
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<ul class="simple">
<li>Jordi Ballester Alomar &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
Expand All @@ -443,7 +454,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
Loading