You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.9 KiB

8 years ago
  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ==========
  5. Web Notify
  6. ==========
  7. Send instant notification messages to the user in live.
  8. This technical module allows you to send instant notification messages from the server to the user in live.
  9. Two kinds of notification are supported.
  10. * Warning: Displayed in a red flying popup div
  11. * Information: Displayed in a light yellow flying popup div
  12. To send a notification to the user you just need to call one of the new methods defined on res.users:
  13. .. code-block:: python
  14. self.env.user.notify_info('My information message')
  15. or
  16. .. code-block:: python
  17. self.env.user.notify_warning('My marning message')
  18. .. figure:: static/description/notifications_screenshot.png
  19. :scale: 80 %
  20. :alt: Sample notifications
  21. The notifications can bring interactivity with some buttons.
  22. * One allowing to refresh the active view
  23. * Another allowing to send a window / client action
  24. The reload button is activated when sending the notification with:
  25. .. code-block:: python
  26. self.env.user.notify_info('My information message', show_reload=True)
  27. The action can be used using the ``action`` keyword:
  28. .. code-block:: python
  29. action = self.env.ref('sale.action_orders').read()[0]
  30. action.update({
  31. 'res_id': self.id,
  32. 'views': [(False, 'form')],
  33. })
  34. self.env.user.notify_info(
  35. 'My information message',
  36. action=action,
  37. # optional
  38. action_link_name=_('Open Sale'),
  39. )
  40. Installation
  41. ============
  42. This module is based on the Instant Messaging Bus. To work properly, the server must be launched in gevent mode.
  43. Usage
  44. =====
  45. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  46. :alt: Try me on Runbot
  47. :target: https://runbot.odoo-community.org/runbot/162/10.0
  48. Bug Tracker
  49. ===========
  50. Bugs are tracked on `GitHub Issues
  51. <https://github.com/OCA/web/issues>`_. In case of trouble, please
  52. check there if your issue has already been reported. If you spotted it first,
  53. help us smashing it by providing a detailed and welcomed feedback.
  54. Credits
  55. =======
  56. Images
  57. ------
  58. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  59. Contributors
  60. ------------
  61. * Laurent Mignon <laurent.mignon@acsone.eu>
  62. * Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com>
  63. * Guewen Baconnier <guewen.baconnier@camptocamp.com>
  64. Maintainer
  65. ----------
  66. .. image:: https://odoo-community.org/logo.png
  67. :alt: Odoo Community Association
  68. :target: https://odoo-community.org
  69. This module is maintained by the OCA.
  70. OCA, or the Odoo Community Association, is a nonprofit organization whose
  71. mission is to support the collaborative development of Odoo features and
  72. promote its widespread use.
  73. To contribute to this module, please visit https://odoo-community.org.