Browse Source

[UPD] README.rst

pull/1198/head
OCA-git-bot 6 years ago
parent
commit
410b643de5
  1. 30
      web_notify/README.rst
  2. 22
      web_notify/static/description/index.html

30
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 <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>
Maintainers
~~~~~~~~~~~

22
web_notify/static/description/index.html

@ -372,8 +372,11 @@ ul.auto-toc {
<p>This technical module allows you to send instant notification messages from the server to the user in live.
Two kinds of notification are supported.</p>
<ul class="simple">
<li>Warning: Displayed in a red flying popup div</li>
<li>Information: Displayed in a light yellow flying popup div</li>
<li>Success: Displayed in a <cite>success</cite> theme color flying popup div</li>
<li>Danger: Displayed in a <cite>danger</cite> theme color flying popup div</li>
<li>Warning: Displayed in a <cite>warning</cite> theme color flying popup div</li>
<li>Information: Displayed in a <cite>info</cite> theme color flying popup div</li>
<li>Default: Displayed in a <cite>default</cite> theme color flying popup div</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
@ -397,11 +400,23 @@ Two kinds of notification are supported.</p>
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
<p>To send a notification to the user you just need to call one of the new methods defined on res.users:</p>
<pre class="code python literal-block">
<span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">notify_success</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s1">'My success message'</span><span class="p">)</span>
</pre>
<p>or</p>
<pre class="code python literal-block">
<span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">notify_danger</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s1">'My danger message'</span><span class="p">)</span>
</pre>
<p>or</p>
<pre class="code python literal-block">
<span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">notify_warning</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s1">'My warning message'</span><span class="p">)</span>
</pre>
<p>or</p>
<pre class="code python literal-block">
<span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">notify_info</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s1">'My information message'</span><span class="p">)</span>
</pre>
<p>or</p>
<pre class="code python literal-block">
<span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">notify_warning</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s1">'My marning message'</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">notify_default</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s1">'My default message'</span><span class="p">)</span>
</pre>
<div class="figure">
<img alt="Sample notifications" src="https://raw.githubusercontent.com/OCA/web/12.0/web_notify/static/description/notifications_screenshot.png" />
@ -435,6 +450,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Serpent Consulting Services Pvt. Ltd.&lt;<a class="reference external" href="mailto:jay.vora&#64;serpentcs.com">jay.vora&#64;serpentcs.com</a>&gt;</li>
<li>Aitor Bouzas &lt;<a class="reference external" href="mailto:aitor.bouzas&#64;adaptivecity.com">aitor.bouzas&#64;adaptivecity.com</a>&gt;</li>
<li>Shepilov Vladislav &lt;<a class="reference external" href="mailto:shepilov.v&#64;protonmail.com">shepilov.v&#64;protonmail.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">

Loading…
Cancel
Save