From c9ec4c5abff273e2640c2d57eb61191b364ca54b Mon Sep 17 00:00:00 2001 From: Hans Henrik Gabelgaard Date: Mon, 18 Dec 2023 19:06:09 +0100 Subject: [PATCH 1/2] [IMP] web_notity: HTML formatting --- web_notify/models/res_users.py | 25 +++++++++++++++---- .../js/services/notification_services.esm.js | 1 + web_notify/tests/test_res_users.py | 5 ++++ .../models/res_users.py | 3 +++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/web_notify/models/res_users.py b/web_notify/models/res_users.py index eca87abc6e56..2b82fd21d62b 100644 --- a/web_notify/models/res_users.py +++ b/web_notify/models/res_users.py @@ -49,10 +49,13 @@ def notify_success( sticky=False, target=None, action=None, + html=False, params=None, ): title = title or _("Success") - self._notify_channel(SUCCESS, message, title, sticky, target, action, params) + self._notify_channel( + SUCCESS, message, title, sticky, target, html, action, params + ) def notify_danger( self, @@ -60,11 +63,14 @@ def notify_danger( title=None, sticky=False, target=None, + html=False, action=None, params=None, ): title = title or _("Danger") - self._notify_channel(DANGER, message, title, sticky, target, action, params) + self._notify_channel( + DANGER, message, title, sticky, target, html, action, params + ) def notify_warning( self, @@ -72,11 +78,14 @@ def notify_warning( title=None, sticky=False, target=None, + html=False, action=None, params=None, ): title = title or _("Warning") - self._notify_channel(WARNING, message, title, sticky, target, action, params) + self._notify_channel( + WARNING, message, title, sticky, target, html, action, params + ) def notify_info( self, @@ -84,11 +93,12 @@ def notify_info( title=None, sticky=False, target=None, + html=False, action=None, params=None, ): title = title or _("Information") - self._notify_channel(INFO, message, title, sticky, target, action, params) + self._notify_channel(INFO, message, title, sticky, target, html, action, params) def notify_default( self, @@ -96,11 +106,14 @@ def notify_default( title=None, sticky=False, target=None, + html=False, action=None, params=None, ): title = title or _("Default") - self._notify_channel(DEFAULT, message, title, sticky, target, action, params) + self._notify_channel( + DEFAULT, message, title, sticky, target, html, action, params + ) def _notify_channel( self, @@ -109,6 +122,7 @@ def _notify_channel( title=None, sticky=False, target=None, + html=False, action=None, params=None, ): @@ -127,6 +141,7 @@ def _notify_channel( "message": message, "title": title, "sticky": sticky, + "html": html, "action": action, "params": dict(params or []), } diff --git a/web_notify/static/src/js/services/notification_services.esm.js b/web_notify/static/src/js/services/notification_services.esm.js index 1ac2f71d69c1..4daabd3844e9 100644 --- a/web_notify/static/src/js/services/notification_services.esm.js +++ b/web_notify/static/src/js/services/notification_services.esm.js @@ -29,6 +29,7 @@ export const webNotificationService = { type: notification.type, sticky: notification.sticky, className: notification.className, + messageIsHtml: notification.html, buttons: buttons.map((button) => { const onClick = button.onClick; button.onClick = async () => { diff --git a/web_notify/tests/test_res_users.py b/web_notify/tests/test_res_users.py index ae7deca1161e..e146c5ffa41d 100644 --- a/web_notify/tests/test_res_users.py +++ b/web_notify/tests/test_res_users.py @@ -18,6 +18,7 @@ def test_notify_success(self): "message": "message", "title": "title", "sticky": True, + "html": False, "action": None, "params": {}, } @@ -37,6 +38,7 @@ def test_notify_danger(self): "message": "message", "title": "title", "sticky": True, + "html": False, "action": None, "params": {}, } @@ -56,6 +58,7 @@ def test_notify_warning(self): "message": "message", "title": "title", "sticky": True, + "html": False, "action": None, "params": {}, } @@ -75,6 +78,7 @@ def test_notify_info(self): "message": "message", "title": "title", "sticky": True, + "html": False, "action": None, "params": {}, } @@ -94,6 +98,7 @@ def test_notify_default(self): "message": "message", "title": "title", "sticky": True, + "html": False, "action": None, "params": {}, } diff --git a/web_notify_channel_message/models/res_users.py b/web_notify_channel_message/models/res_users.py index 570af514ef31..a3c7162418cf 100644 --- a/web_notify_channel_message/models/res_users.py +++ b/web_notify_channel_message/models/res_users.py @@ -11,6 +11,7 @@ def _notify_channel( title=None, sticky=False, target=None, + html=False, action=None, params=None, ): @@ -21,6 +22,7 @@ def _notify_channel( title=title, sticky=sticky, target=target, + html=html, action=action, params=params, ) @@ -30,6 +32,7 @@ def _notify_channel( title=title, sticky=sticky, target=target, + html=html, action=action, params=params, ) From 90fdad2c9ff9935bc1c278f3edd1ad60a4993095 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 29 Sep 2025 10:05:10 +0000 Subject: [PATCH 2/2] [BOT] post-merge updates --- README.md | 4 +-- web_notify/README.rst | 2 +- web_notify/__manifest__.py | 2 +- web_notify/static/description/index.html | 2 +- web_notify_channel_message/README.rst | 8 ++++-- web_notify_channel_message/__manifest__.py | 2 +- .../static/description/index.html | 26 ++++++++++++------- 7 files changed, 28 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 91df777ad946..2d9d70d3fc76 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ addon | version | maintainers | summary [web_ir_actions_act_window_message](web_ir_actions_act_window_message/) | 18.0.1.0.0 | | Show a message box to users [web_m2x_options](web_m2x_options/) | 18.0.1.0.1 | | web_m2x_options [web_no_bubble](web_no_bubble/) | 18.0.1.0.0 | | Remove the bubbles from the web interface -[web_notify](web_notify/) | 18.0.1.1.0 | | Send notification messages to user -[web_notify_channel_message](web_notify_channel_message/) | 18.0.1.0.0 | | Send an instant notification to channel users when a new message is posted +[web_notify](web_notify/) | 18.0.1.1.1 | | Send notification messages to user +[web_notify_channel_message](web_notify_channel_message/) | 18.0.1.0.1 | | Send an instant notification to channel users when a new message is posted [web_notify_upgrade](web_notify_upgrade/) | 18.0.1.0.0 | | Notify active users when a module is installed or updated [web_pivot_computed_measure](web_pivot_computed_measure/) | 18.0.1.0.5 | CarlosRoca13 | Web Pivot Computed Measure [web_quick_start_screen](web_quick_start_screen/) | 18.0.1.0.0 | | Configurable start screen for quick actions diff --git a/web_notify/README.rst b/web_notify/README.rst index 205706213578..37dcbc7ab7b1 100644 --- a/web_notify/README.rst +++ b/web_notify/README.rst @@ -11,7 +11,7 @@ Web Notify !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:db8e4b2dd61e85e61e2b3a50f14d0642d9dfeec1dc7046d2e244f1cb35d3720c + !! source digest: sha256:c087e4a564febe99ec4833cde4e3e775a04ca6bf574c41e69070e910a37512af !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/web_notify/__manifest__.py b/web_notify/__manifest__.py index 450054efd0b4..baf503bac069 100644 --- a/web_notify/__manifest__.py +++ b/web_notify/__manifest__.py @@ -6,7 +6,7 @@ "name": "Web Notify", "summary": """ Send notification messages to user""", - "version": "18.0.1.1.0", + "version": "18.0.1.1.1", "license": "LGPL-3", "author": "ACSONE SA/NV," "AdaptiveCity," "Odoo Community Association (OCA)", "development_status": "Production/Stable", diff --git a/web_notify/static/description/index.html b/web_notify/static/description/index.html index daa88828695b..37071c707945 100644 --- a/web_notify/static/description/index.html +++ b/web_notify/static/description/index.html @@ -372,7 +372,7 @@

Web Notify

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:db8e4b2dd61e85e61e2b3a50f14d0642d9dfeec1dc7046d2e244f1cb35d3720c +!! source digest: sha256:c087e4a564febe99ec4833cde4e3e775a04ca6bf574c41e69070e910a37512af !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: LGPL-3 OCA/web Translate me on Weblate Try me on Runboat

Send instant notification messages to the user in live.

diff --git a/web_notify_channel_message/README.rst b/web_notify_channel_message/README.rst index 778b54988753..e6c171dbfc6b 100644 --- a/web_notify_channel_message/README.rst +++ b/web_notify_channel_message/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ========================== Web Notify Channel Message ========================== @@ -7,13 +11,13 @@ Web Notify Channel Message !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:6047cc1715c1c9f1835efc8ac828d45b54d307cb5ff43368e40ecbc79b0575f0 + !! source digest: sha256:11845b462bb3c2336ae264335bcd2416a6fc49c1455bddea10b9ccc8637d6312 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png :target: https://odoo-community.org/page/development-status :alt: Alpha -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-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%2Fweb-lightgray.png?logo=github diff --git a/web_notify_channel_message/__manifest__.py b/web_notify_channel_message/__manifest__.py index 7eee0e4f2762..faa8177efee2 100644 --- a/web_notify_channel_message/__manifest__.py +++ b/web_notify_channel_message/__manifest__.py @@ -6,7 +6,7 @@ "name": "Web Notify Channel Message", "summary": """ Send an instant notification to channel users when a new message is posted""", - "version": "18.0.1.0.0", + "version": "18.0.1.0.1", "license": "AGPL-3", "author": "ForgeFlow, Odoo Community Association (OCA)", "development_status": "Alpha", diff --git a/web_notify_channel_message/static/description/index.html b/web_notify_channel_message/static/description/index.html index e5cb7f61de93..2ae891dcf382 100644 --- a/web_notify_channel_message/static/description/index.html +++ b/web_notify_channel_message/static/description/index.html @@ -3,7 +3,7 @@ -Web Notify Channel Message +README.rst -
-

Web Notify Channel Message

+
+ + +Odoo Community Association + +
+

Web Notify Channel Message

-

Alpha License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

Alpha License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module will send an instant notifications to all users of a channel when a new message has been posted.

@@ -391,7 +396,7 @@

Web Notify Channel Message

-

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 @@ -399,15 +404,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • ForgeFlow
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -429,5 +434,6 @@

Maintainers

+