diff --git a/web_notify/README.rst b/web_notify/README.rst index 6f8c52c2..419d96d9 100644 --- a/web_notify/README.rst +++ b/web_notify/README.rst @@ -23,15 +23,18 @@ Web Notify :target: https://runbot.odoo-community.org/runbot/162/12.0 :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| 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 +* 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 **Table of contents** @@ -49,6 +52,24 @@ Usage 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_success(message='My success message') + +or + +.. code-block:: python + + 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') @@ -57,7 +78,7 @@ or .. code-block:: python - self.env.user.notify_warning(message='My marning message') + self.env.user.notify_default(message='My default message') .. figure:: https://raw.githubusercontent.com/OCA/web/12.0/web_notify/static/description/notifications_screenshot.png :scale: 80 % @@ -95,6 +116,7 @@ Contributors * Laurent Mignon * Serpent Consulting Services Pvt. Ltd. * Aitor Bouzas +* Shepilov Vladislav Maintainers ~~~~~~~~~~~ diff --git a/web_notify/static/description/index.html b/web_notify/static/description/index.html index 1c7016e2..9d01e534 100644 --- a/web_notify/static/description/index.html +++ b/web_notify/static/description/index.html @@ -372,8 +372,11 @@ ul.auto-toc {

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

Table of contents

@@ -397,11 +400,23 @@ Two kinds of notification are supported.

Usage

To send a notification to the user you just need to call one of the new methods defined on res.users:

+self.env.user.notify_success(message='My success message')
+
+

or

+
+self.env.user.notify_danger(message='My danger message')
+
+

or

+
+self.env.user.notify_warning(message='My warning message')
+
+

or

+
 self.env.user.notify_info(message='My information message')
 

or

-self.env.user.notify_warning(message='My marning message')
+self.env.user.notify_default(message='My default message')
 
Sample notifications @@ -435,6 +450,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Laurent Mignon <laurent.mignon@acsone.eu>
  • Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com>
  • Aitor Bouzas <aitor.bouzas@adaptivecity.com>
  • +
  • Shepilov Vladislav <shepilov.v@protonmail.com>