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 trisdoan
parent 619b8883a0
commit 557e35203a
5 changed files with 126 additions and 22 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