mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_notify: Migration to 12.0
Add self-test buttons in demo environment, Updated readme to show how to test it. Add buttons to users form Do not rely on SUPERUSER_ID and avoid getattr usage
This commit is contained in:
3
web_notify/readme/CONTRIBUTORS.rst
Normal file
3
web_notify/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
* Laurent Mignon <laurent.mignon@acsone.eu>
|
||||
* Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com>
|
||||
* Aitor Bouzas <aitor.bouzas@adaptivecity.com>
|
||||
7
web_notify/readme/DESCRIPTION.rst
Normal file
7
web_notify/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
Send instant notification messages to the user in live.
|
||||
|
||||
This technical module allows you to send instant notification messages from the server to the user in live.
|
||||
Two kinds of notification are supported.
|
||||
|
||||
* Warning: Displayed in a red flying popup div
|
||||
* Information: Displayed in a light yellow flying popup div
|
||||
1
web_notify/readme/INSTALL.rst
Normal file
1
web_notify/readme/INSTALL.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module is based on the Instant Messaging Bus. To work properly, the server must be launched in gevent mode.
|
||||
23
web_notify/readme/USAGE.rst
Normal file
23
web_notify/readme/USAGE.rst
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
To send a notification to the user you just need to call one of the new methods defined on res.users:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.env.user.notify_info(message='My information message')
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.env.user.notify_warning(message='My marning message')
|
||||
|
||||
.. figure:: static/description/notifications_screenshot.png
|
||||
:scale: 80 %
|
||||
:alt: Sample notifications
|
||||
|
||||
You can test the behaviour of the notifications by installing this module in a demo database.
|
||||
Access the users form through Settings -> Users & Companies. You'll see a tab called "Test web notify", here you'll find two buttons that'll allow you test the module.
|
||||
|
||||
.. figure:: static/description/test_notifications_demo.png
|
||||
:scale: 80 %
|
||||
:alt: Sample notifications
|
||||
Reference in New Issue
Block a user