Merge PR #1385 into 17.0

Signed-off-by pedrobaeza
pull/1437/head
OCA-git-bot 2024-08-05 10:30:54 +00:00
commit a7329453f1
4 changed files with 36 additions and 11 deletions

View File

@ -67,6 +67,15 @@ Usage
Go to any model that contains a chatter (e.g. Contacts, ...). Search for Go to any model that contains a chatter (e.g. Contacts, ...). Search for
content in field 'Message Content'. 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 Bug Tracker
=========== ===========

View File

@ -44,7 +44,11 @@ class MailThread(models.AbstractModel):
that inherits mail.thread that inherits mail.thread
""" """
res = super().get_view(view_id=view_id, view_type=view_type, options=options) 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"]) doc = etree.XML(res["arch"])
for node in doc.xpath("/search/field[last()]"): for node in doc.xpath("/search/field[last()]"):
# Add message_content in search view # Add message_content in search view

View File

@ -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.

View File

@ -390,11 +390,12 @@ body, email from, reply to and record name.</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li> <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="#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="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul> <li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li> <li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li> <li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</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> </ul>
</li> </li>
</ul> </ul>
@ -409,8 +410,18 @@ mail.message: subject, body, record_name, email_from, reply_to.</p>
<p>Go to any model that contains a chatter (e.g. Contacts, …). Search for <p>Go to any model that contains a chatter (e.g. Contacts, …). Search for
content in field Message Content.</p> content in field Message Content.</p>
</div> </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"> <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>. <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. 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 If you spotted it first, help us to smash it by providing a detailed and welcomed
@ -418,9 +429,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <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"> <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"> <ul class="simple">
<li>ForgeFlow</li> <li>ForgeFlow</li>
<li>SerpentCS</li> <li>SerpentCS</li>
@ -428,7 +439,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <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"> <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>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> <li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
@ -443,7 +454,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <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> <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> <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 <p>OCA, or the Odoo Community Association, is a nonprofit organization whose