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
2.9 KiB

  1. ==================================
  2. Add new options for many2one field
  3. ==================================
  4. Description
  5. -----------
  6. This module changes "many2one" and "many2manytags" form widgets, so as to
  7. add some new display control options.
  8. ** New: support many2manytags widget ! **
  9. ** New: support global option management with ir.config_parameter ! **
  10. The options provided include the possibility to remove "Create..." and/or
  11. "Create and Edit..." entries from many2one and many2many drop down lists. You
  12. can also change the default number of entries appearing in the drop-down, or
  13. prevent the dialog box poping in case of validation error occurring.
  14. If not specified, the module will avoid proposing any of the create options
  15. if the current user have no permission rights to create the related object.
  16. Requirements
  17. ------------
  18. Was tested on openerp v7.0
  19. New option
  20. ----------
  21. ``create`` *boolean* (Default: depends if user have create rights)
  22. Whether to display the "Create..." entry in dropdown panel.
  23. ``create_edit`` *boolean* (Default: depends if user have create rights)
  24. Whether to display "Create and Edit..." entry in dropdown panel
  25. ``m2o_dialog`` *boolean* (Default: depends if user have create rights)
  26. Whether to display the many2one dialog in case of validation error.
  27. ``limit`` *int* (Default: openerp default value is ``7``)
  28. Number of displayed record in drop-down panel
  29. ir.config_parameter options
  30. ---------------------------
  31. Now you can disable "Create..." and "Create and Edit..." entry for all widgets in the odoo instance.
  32. If you disable one option, you can enable it for particular field by setting "create: True" option directly on the field definition.
  33. ``web_m2x_options.create`` *boolean* (Default: depends if user have create rights)
  34. Whether to display the "Create..." entry in dropdown panel for all fields in the odoo instance.
  35. ``web_m2x_options.create_edit`` *boolean* (Default: depends if user have create rights)
  36. Whether to display "Create and Edit..." entry in dropdown panel for all fields in the odoo instance.
  37. ``web_m2x_options.limit`` *int* (Default: openerp default value is ``7``)
  38. Number of displayed records in drop-down panel for all fields in the odoo instance
  39. To add these parameters go to Configuration -> Technical -> Parameters -> System Parameters and add new parameters like:
  40. - web_m2x_options.create: False
  41. - web_m2x_options.create_edit: False
  42. - web_m2x_options.limit: 10
  43. Example
  44. -------
  45. Your XML form view definition could contain::
  46. ...
  47. <field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>
  48. ...
  49. Note
  50. ----
  51. Double check that you have no inherited view that remote ``options`` you set on a field !
  52. If nothing work, add a debugger in the first line of ``get_search_result`` method and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.