-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to return an action in a notification
- Loading branch information
1 parent
8b258c8
commit d8d9e0e
Showing
5 changed files
with
126 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,13 +72,28 @@ or | |
|
||
.. code-block:: python | ||
self.env.user.notify_info(message='My information message') | ||
self.env.user.notify_default(message='My default message') | ||
or | ||
The notifications can bring interactivity with some buttons. | ||
|
||
* One allowing to refresh the active view | ||
* Another allowing to send a window / client action | ||
|
||
The reload button is activated when sending the notification with: | ||
|
||
|
||
The action can be used using the ``action`` keyword: | ||
|
||
.. code-block:: python | ||
self.env.user.notify_default(message='My default message') | ||
action = self.env.ref('sale.action_orders').read()[0] | ||
action.update({ | ||
'res_id': self.id, | ||
'views': [(False, 'form')], | ||
}) | ||
self.env.user.notify_info('My information message', action=action) | ||
.. figure:: https://raw.githubusercontent.com/OCA/web/16.0/web_notify/static/description/notifications_screenshot.gif | ||
:scale: 80 % | ||
|
@@ -118,6 +133,7 @@ Contributors | |
* Aitor Bouzas <[email protected]> | ||
* Shepilov Vladislav <[email protected]> | ||
* Kevin Khao <[email protected]> | ||
* Guewen Baconnier <[email protected]> | ||
* `Tecnativa <https://www.tecnativa.com>`_: | ||
|
||
* David Vidal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters