mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] web_notify: Add possibility to return an action in a notification
This commit is contained in:
committed by
Laurent Stukkens
parent
dac33645f2
commit
5d1c3d5fd7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user