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.

196 lines
7.1 KiB

  1. ===============
  2. web_m2x_options
  3. ===============
  4. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  5. !! This file is generated by oca-gen-addon-readme !!
  6. !! changes will be overwritten. !!
  7. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8. .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
  9. :target: https://odoo-community.org/page/development-status
  10. :alt: Beta
  11. .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
  12. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  13. :alt: License: AGPL-3
  14. .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
  15. :target: https://github.com/OCA/web/tree/11.0/web_m2x_options
  16. :alt: OCA/web
  17. .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
  18. :target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_m2x_options
  19. :alt: Translate me on Weblate
  20. .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
  21. :target: https://runbot.odoo-community.org/runbot/162/11.0
  22. :alt: Try me on Runbot
  23. |badge1| |badge2| |badge3| |badge4| |badge5|
  24. This modules modifies "many2one" and "many2manytags" form widgets so as to add some new display
  25. control options.
  26. Options provided includes possibility to remove "Create..." and/or "Create and
  27. Edit..." entries from many2one drop down. You can also change default number of
  28. proposition appearing in the drop-down. Or prevent the dialog box poping in
  29. case of validation error.
  30. If not specified, the module will avoid proposing any of the create options
  31. if the current user has no permission rights to create the related object.
  32. **Table of contents**
  33. .. contents::
  34. :local:
  35. Usage
  36. =====
  37. in the field's options dict
  38. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39. ``create`` *boolean* (Default: depends if user have create rights)
  40. Whether to display the "Create..." entry in dropdown panel.
  41. ``create_edit`` *boolean* (Default: depends if user have create rights)
  42. Whether to display "Create and Edit..." entry in dropdown panel
  43. ``m2o_dialog`` *boolean* (Default: depends if user have create rights)
  44. Whether to display the many2one dialog in case of validation error.
  45. ``limit`` *int* (Default: openerp default value is ``7``)
  46. Number of displayed record in drop-down panel
  47. ``search_more`` *boolean*
  48. Used to force disable/enable search more button.
  49. ``field_color`` *string*
  50. A string to define the field used to define color.
  51. This option has to be used with colors.
  52. ``colors`` *dictionary*
  53. A dictionary to link field value with a HTML color.
  54. This option has to be used with field_color.
  55. ``no_open_edit`` *boolean* (Default: value of ``no_open`` which is ``False`` if not set)
  56. Causes a many2one not to offer to click through in edit mode, but well in read mode
  57. ``open`` *boolean* (Default: ``False``)
  58. Makes many2many_tags buttons that open the linked resource
  59. ``no_color_picker`` *boolean* (Default: ``False``)
  60. Deactivates the color picker on many2many_tags buttons to do nothing (ignored if open is set)
  61. ir.config_parameter options
  62. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  63. Now you can disable "Create..." and "Create and Edit..." entry for all widgets in the odoo instance.
  64. If you disable one option, you can enable it for particular field by setting "create: True" option directly on the field definition.
  65. ``web_m2x_options.create`` *boolean* (Default: depends if user have create rights)
  66. Whether to display the "Create..." entry in dropdown panel for all fields in the odoo instance.
  67. ``web_m2x_options.create_edit`` *boolean* (Default: depends if user have create rights)
  68. Whether to display "Create and Edit..." entry in dropdown panel for all fields in the odoo instance.
  69. ``web_m2x_options.m2o_dialog`` *boolean* (Default: depends if user have create rights)
  70. Whether to display the many2one dialog in case of validation error for all fields in the odoo instance.
  71. ``web_m2x_options.limit`` *int* (Default: openerp default value is ``7``)
  72. Number of displayed record in drop-down panel for all fields in the odoo instance
  73. ``web_m2x_options.search_more`` *boolean* (Default: default value is ``False``)
  74. Whether the field should always show "Search more..." entry or not.
  75. To add these parameters go to Configuration -> Technical -> Parameters -> System Parameters and add new parameters like:
  76. - web_m2x_options.create: False
  77. - web_m2x_options.create_edit: False
  78. - web_m2x_options.m2o_dialog: False
  79. - web_m2x_options.limit: 10
  80. - web_m2x_options.search_more: True
  81. Example
  82. ~~~~~~~
  83. Your XML form view definition could contain::
  84. ...
  85. <field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more':true 'field_color':'state', 'colors':{'active':'green'}}"/>
  86. ...
  87. Known issues / Roadmap
  88. ======================
  89. Double check that you have no inherited view that remove ``options`` you set on a field !
  90. If nothing works, add a debugger in the first line of ``_search method`` and enable debug mode in Odoo. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.
  91. - Instead of making the tags rectangle clickable, I think it's better to put the text as a clickable link, so we will get a consistent behaviour/aspect with other clickable elements (many2one...).
  92. - In edit mode, it would be great to add an icon like the one on many2one fields to allow to open the many2many in a popup window.
  93. - Include this feature as a configurable option via parameter to have this behaviour by default in all many2many tags.
  94. Bug Tracker
  95. ===========
  96. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  97. In case of trouble, please check there if your issue has already been reported.
  98. If you spotted it first, help us smashing it by providing a detailed and welcomed
  99. `feedback <https://github.com/OCA/web/issues/new?body=module:%20web_m2x_options%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  100. Do not contact contributors directly about support or help with technical issues.
  101. Credits
  102. =======
  103. Authors
  104. ~~~~~~~
  105. * ACSONE SA/NV
  106. * 0k.io
  107. * Tecnativa
  108. Contributors
  109. ~~~~~~~~~~~~
  110. * David Coninckx <davconinckx@gmail.com>
  111. * Emanuel Cino <ecino@compassion.ch>
  112. * Holger Brunn <hbrunn@therp.nl>
  113. * Nicolas JEUDY <nicolas@sudokeys.com>
  114. * Yannick Vaucher <yannick.vaucher@camptocamp.com>
  115. * Zakaria Makrelouf <z.makrelouf@gmail.com>
  116. * `Tecnativa <https://www.tecnativa.com>`_:
  117. * Jairo Llopis <jairo.llopis@tecnativa.com>
  118. * David Vidal <david.vidal@tecnativa.com>
  119. * Ernesto Tejeda <ernesto.tejeda87@gmail.com>
  120. Maintainers
  121. ~~~~~~~~~~~
  122. This module is maintained by the OCA.
  123. .. image:: https://odoo-community.org/logo.png
  124. :alt: Odoo Community Association
  125. :target: https://odoo-community.org
  126. OCA, or the Odoo Community Association, is a nonprofit organization whose
  127. mission is to support the collaborative development of Odoo features and
  128. promote its widespread use.
  129. This module is part of the `OCA/web <https://github.com/OCA/web/tree/11.0/web_m2x_options>`_ project on GitHub.
  130. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.