diff --git a/web_m2x_options/README.rst b/web_m2x_options/README.rst index 0fa46e05..d7200121 100644 --- a/web_m2x_options/README.rst +++ b/web_m2x_options/README.rst @@ -78,6 +78,10 @@ If you disable one option, you can enable it for particular field by setting "cr Whether to display "Create and Edit..." entry in dropdown panel for all fields in the odoo instance. +``web_m2x_options.m2o_dialog`` *boolean* (Default: depends if user have create rights) + + Whether to display the many2one dialog in case of validation error for all fields in the odoo instance. + ``web_m2x_options.limit`` *int* (Default: openerp default value is ``7``) Number of displayed records in drop-down panel for all fields in the odoo instance @@ -90,6 +94,7 @@ To add these parameters go to Configuration -> Technical -> Parameters -> System - web_m2x_options.create: False - web_m2x_options.create_edit: False +- web_m2x_options.m2o_dialog: False - web_m2x_options.limit: 10 - web_m2x_options.search_more: True diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 208e7e92..d2fb48da 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -11,7 +11,8 @@ openerp.web_m2x_options = function (instance) { var OPTIONS = ['web_m2x_options.create', 'web_m2x_options.create_edit', 'web_m2x_options.limit', - 'web_m2x_options.search_more',]; + 'web_m2x_options.search_more', + 'web_m2x_options.m2o_dialog',]; instance.web.form.FieldMany2One = instance.web.form.FieldMany2One.extend({ @@ -39,8 +40,8 @@ openerp.web_m2x_options = function (instance) { }, show_error_displayer: function () { - if ((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || - this.options.m2o_dialog) { + if (((typeof this.options.m2o_dialog === 'undefined' && this.can_create) || + this.options.m2o_dialog) && (!this.view.ir_options['web_m2x_options.search_more'] === "False")) { new instance.web.form.M2ODialog(this).open(); } },