3
0
Fork 0

Merge PR #2382 into 14.0

Signed-off-by etobella
14.0
OCA-git-bot 2023-02-13 08:38:50 +00:00
commit eb9e30edd3
9 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1 @@
../../../../web_notify_channel_message

View File

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@ -0,0 +1 @@
from . import models

View File

@ -0,0 +1,16 @@
# pylint: disable=missing-docstring
# Copyright 2023 ForgeFlow, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Web Notify Channel Message",
"summary": """
Send an instant notification to channel users when a new message is posted""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"development_status": "Alpha",
"website": "https://github.com/OCA/web",
"depends": ["web_notify", "mail"],
"installable": True,
}

View File

@ -0,0 +1 @@
from . import mail_channel

View File

@ -0,0 +1,21 @@
# pylint: disable=missing-docstring
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, models
class MailChannel(models.Model):
_inherit = "mail.channel"
def message_post(self, *, message_type="notification", **kwargs):
message = super().message_post(message_type=message_type, **kwargs)
for partner in self.channel_partner_ids:
users = partner.user_ids
for user in users:
if user in message.author_id.user_ids:
continue
user.notify_info(
message=_("You have a new message in channel %s") % self.name
)
return message

View File

@ -0,0 +1,4 @@
* Joan Sisquella <joan.sisquella@forgeflow.com>
* Thiago Mulero <thiago.mulero@forgeflow.com>
* David Jimenez <david.jimenez@forgeflow.com>
* Jordi Ballester <jordi.ballester@forgefow.com>

View File

@ -0,0 +1 @@
This module will send an instant notifications to all users of a channel when a new message has been posted.