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:
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