mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[12.0] web_notify: improve popup UI (#1231)
* [ADD]: all available bootstrap notifications (success/danger/warning/info/default) * [IMP] use black color for text for default notification. * [FIX] reverted require string for `bus.Longpolling` and rename `on_message_received` to `on_message` to prevent collisions.
This commit is contained in:
committed by
David
parent
af2656ba00
commit
3db7072296
@@ -1,3 +1,4 @@
|
||||
* Laurent Mignon <laurent.mignon@acsone.eu>
|
||||
* Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com>
|
||||
* Aitor Bouzas <aitor.bouzas@adaptivecity.com>
|
||||
* Aitor Bouzas <aitor.bouzas@adaptivecity.com>
|
||||
* Shepilov Vladislav <shepilov.v@protonmail.com>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
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.
|
||||
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
|
||||
* Success: Displayed in a `success` theme color flying popup div
|
||||
* Danger: Displayed in a `danger` theme color flying popup div
|
||||
* Warning: Displayed in a `warning` theme color flying popup div
|
||||
* Information: Displayed in a `info` theme color flying popup div
|
||||
* Default: Displayed in a `default` theme color flying popup div
|
||||
|
||||
@@ -1 +1 @@
|
||||
This module is based on the Instant Messaging Bus. To work properly, the server must be launched in gevent mode.
|
||||
This module is based on the Instant Messaging Bus. To work properly, the server must be launched in gevent mode.
|
||||
|
||||
@@ -2,14 +2,32 @@
|
||||
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
|
||||
self.env.user.notify_success(message='My success message')
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.env.user.notify_warning(message='My marning message')
|
||||
|
||||
self.env.user.notify_danger(message='My danger message')
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.env.user.notify_warning(message='My warning message')
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.env.user.notify_info(message='My information message')
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.env.user.notify_default(message='My default message')
|
||||
|
||||
.. figure:: static/description/notifications_screenshot.png
|
||||
:scale: 80 %
|
||||
|
||||
Reference in New Issue
Block a user