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.

123 lines
2.8 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. Web widget boolean switch
  6. =========================
  7. This module add a widget to render boolean fields
  8. Installation
  9. ============
  10. To install this module, you need to:
  11. * do this ...
  12. Configuration
  13. =============
  14. Example
  15. -------
  16. ```xml
  17. <field name="active"
  18. widget="boolean_switch"
  19. options="{'quick_edit': True, extra: {'onText': 'Yes', 'offText': 'No' }"/>
  20. ```
  21. Options
  22. -------
  23. quick_edit
  24. ~~~~~~~~~~
  25. extra
  26. ~~~~~
  27. ``extra`` is used to set
  28. `bootstrap-switch <http://www.bootstrap-switch.org/options.html>`_ options.
  29. Available::
  30. * **size**: - default: `null`
  31. * **animate**: - default: `true`
  32. * **indeterminate**: `false`
  33. * **inverse**: `false`
  34. * **radioAllOff**: `false`
  35. * **onColor**: `"primary"`
  36. * **offColor**: `default`
  37. * **onText**: `"ON"`,
  38. * **offText**: `"OFF"`,
  39. * **labelText**: `"&nbsp;"`,
  40. * **handleWidth**: `"auto"`,
  41. * **labelWidth**: `"auto"`,
  42. * **baseClass**: `"bootstrap-switch"`,
  43. * **wrapperClass**: `"wrapper"`,
  44. .. warning::
  45. Those parameters are overwritten by this module or highly discourage::
  46. * **state**: true,
  47. * **disabled**: `false`
  48. * **readonly**: `false`
  49. * **onInit**: `function() {}`,
  50. * **onSwitchChange**: `function() {}`
  51. Usage
  52. =====
  53. To use this module, you need to:
  54. * go to ...
  55. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  56. :alt: Try me on Runbot
  57. :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch}
  58. .. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
  59. .. branch is "8.0" for example
  60. Known issues / Roadmap
  61. ======================
  62. * ...
  63. Bug Tracker
  64. ===========
  65. Bugs are tracked on `GitHub Issues <https://github.com/OCA/
  66. {project_repo}/issues>`_.
  67. In case of trouble, please check there if your issue has already been reported.
  68. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/
  69. {project_repo}/issues/new?body=module:%20
  70. {module_name}%0Aversion:%20
  71. {version}%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  72. Credits
  73. =======
  74. Contributors
  75. ------------
  76. * Pierre Verkest <pverkest@anybox.fr>
  77. Maintainer
  78. ----------
  79. .. image:: https://odoo-community.org/logo.png
  80. :alt: Odoo Community Association
  81. :target: https://odoo-community.org
  82. This module is maintained by the OCA.
  83. OCA, or the Odoo Community Association, is a nonprofit organization whose
  84. mission is to support the collaborative development of Odoo features and
  85. promote its widespread use.
  86. To contribute to this module, please visit http://odoo-community.org.