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.

77 lines
2.6 KiB

  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. Onchange actions
  6. ================
  7. This module allows you to return an action (``ir.actions.*``) from an onchange handler.
  8. This way, you can have much more elaborate message boxes or simply show a whole wizard or do whatever else is possible with actions on the client side.
  9. Usage
  10. =====
  11. Depend on this module and in your onchange handler, add a key ``action`` to the ``warning`` dictionary of the result which contains the definition of an action to execute:
  12. .. code:: python
  13. {
  14. 'value': ....,
  15. 'domain': ....,
  16. 'warning': {
  17. 'title': 'This will be shown if this module is not available',
  18. 'message': 'Fallback message, see above',
  19. # this module picks up this key and shows it *instead* of the
  20. # warning above
  21. 'action': {
  22. 'type': 'ir.actions.act_window',
  23. 'res_model': 'my.wizard',
  24. ...
  25. },
  26. }
  27. The module ``web_ir_actions_act_window_message`` can be quite helpful here.
  28. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  29. :alt: Try me on Runbot
  30. :target: https://runbot.odoo-community.org/runbot/162/8.0
  31. Bug Tracker
  32. ===========
  33. Bugs are tracked on `GitHub Issues
  34. <https://github.com/OCA/web/issues>`_. In case of trouble, please
  35. check there if your issue has already been reported. If you spotted it first,
  36. help us smashing it by providing a detailed and welcomed feedback.
  37. Credits
  38. =======
  39. Images
  40. ------
  41. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  42. Contributors
  43. ------------
  44. * Holger Brunn <hbrunn@therp.nl>
  45. Do not contact contributors directly about help with questions or problems concerning this addon, but use the `community mailing list <mailto:community@mail.odoo.com>`_ or the `appropriate specialized mailinglist <https://odoo-community.org/groups>`_ for help, and the bug tracker linked in `Bug Tracker`_ above for technical issues.
  46. Maintainer
  47. ----------
  48. .. image:: https://odoo-community.org/logo.png
  49. :alt: Odoo Community Association
  50. :target: https://odoo-community.org
  51. This module is maintained by the OCA.
  52. OCA, or the Odoo Community Association, is a nonprofit organization whose
  53. mission is to support the collaborative development of Odoo features and
  54. promote its widespread use.
  55. To contribute to this module, please visit https://odoo-community.org.