[IMP] web_notify: Add possibility to return an action in a notification

This commit is contained in:
Guewen Baconnier
2018-06-27 15:52:14 +02:00
committed by Laurent Stukkens
parent dac33645f2
commit 5d1c3d5fd7
6 changed files with 98 additions and 12 deletions

View File

@@ -29,6 +29,27 @@ or
self.env.user.notify_default(message='My default message')
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
action = self.env["ir.actions.act_window"]._for_xml_id('sale.action_orders')
action.update({
'res_id': self.id,
'views': [(False, 'form')],
})
self.env.user.notify_info('My information message', action=action)
.. figure:: static/description/notifications_screenshot.gif
:scale: 80 %
:alt: Sample notifications