forked from Techsystech/web
commit
eb9e30edd3
|
@ -0,0 +1 @@
|
||||||
|
../../../../web_notify_channel_message
|
|
@ -0,0 +1,6 @@
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
|
@ -0,0 +1 @@
|
||||||
|
from . import models
|
|
@ -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,
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
from . import mail_channel
|
|
@ -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
|
|
@ -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>
|
|
@ -0,0 +1 @@
|
||||||
|
This module will send an instant notifications to all users of a channel when a new message has been posted.
|
Loading…
Reference in New Issue