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.

90 lines
3.0 KiB

  1. Client side message boxes
  2. =========================
  3. This module allows to show a message popup on the client side as result of a button.
  4. Usage
  5. =====
  6. Depend on this module and return
  7. .. code:: python
  8. {
  9. 'type': 'ir.actions.act_window.message',
  10. 'title': _('My title'),
  11. 'message': _('My message'),
  12. # optional title of the close button, if not set, will be _('Close')
  13. # if set False, no close button will be shown
  14. # you can create your own close button with an action of type
  15. # ir.actions.act_window_close
  16. 'close_button_title': 'Make this window go away',
  17. # Use HTML instead of text
  18. 'is_html_message': True,
  19. # this is an optional list of buttons to show
  20. 'buttons': [
  21. # a button can be any action (also ir.actions.report.xml et al)
  22. {
  23. 'type': 'ir.actions.act_window',
  24. 'name': 'All customers',
  25. 'res_model': 'res.partner',
  26. 'view_mode': 'form',
  27. 'views': [[False, 'list'], [False, 'form']],
  28. 'domain': [('customer', '=', True)],
  29. },
  30. # or if type == method, you need to pass a model, a method name and
  31. # parameters
  32. {
  33. 'type': 'method',
  34. 'name': _('Yes, do it'),
  35. 'model': self._name,
  36. 'method': 'myfunction',
  37. # list of arguments to pass positionally
  38. 'args': [self.ids],
  39. # dictionary of keyword arguments
  40. 'kwargs': {'force': True},
  41. # button style
  42. 'classes': 'btn-primary',
  43. }
  44. ]
  45. }
  46. You are responsible for translating the messages.
  47. Known issues / Roadmap
  48. ======================
  49. * add `message_type` to differenciate between warnings, errors, etc.
  50. * have one `message_type` to show a nonmodal warning on top right
  51. Bug Tracker
  52. ===========
  53. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  54. In case of trouble, please check there if your issue has already been reported.
  55. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  56. `here <https://github.com/OCA/web/issues/new?body=module:%20web_ir_actions_act_window_message%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  57. Credits
  58. =======
  59. Contributors
  60. ------------
  61. * Holger Brunn <hbrunn@therp.nl>
  62. * Zakaria Makrelouf (ACSONE SA/NV) <z.makrelouf@gmail.com>
  63. * Benjamin Willig (ACSONE SA/NV) <benjamin.willig@acsone.eu>
  64. Maintainer
  65. ----------
  66. .. image:: http://odoo-community.org/logo.png
  67. :alt: Odoo Community Association
  68. :target: http://odoo-community.org
  69. This module is maintained by the OCA.
  70. OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
  71. To contribute to this module, please visit http://odoo-community.org.