diff --git a/addons/web/i18n/web.pot b/addons/web/i18n/web.pot index e405afb96ca..06166ac4b37 100644 --- a/addons/web/i18n/web.pot +++ b/addons/web/i18n/web.pot @@ -871,6 +871,13 @@ msgstr "" msgid "Error" msgstr "" +#. module: web +#. openerp-web +#: code:addons/web/static/src/js/views/form_widgets.js:458 +#, python-format +msgid "Error: Bad domain" +msgstr "" + #. module: web #: code:addons/web/controllers/main.py:838 #, python-format @@ -2072,6 +2079,13 @@ msgstr "" msgid "Technical Translation" msgstr "" +#. module: web +#. openerp-web +#: code:addons/web/static/src/js/views/form_widgets.js:458 +#, python-format +msgid "The domain is wrong." +msgstr "" + #. module: web #. openerp-web #: code:addons/web/static/src/js/views/form_widgets.js:1208 diff --git a/addons/web/static/src/js/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js index 1214f6e2ce3..b33177eb1d5 100644 --- a/addons/web/static/src/js/views/form_widgets.js +++ b/addons/web/static/src/js/views/form_widgets.js @@ -455,7 +455,13 @@ var FieldCharDomain = common.AbstractField.extend(common.ReinitializeFieldMixin, if (this.get('value')) { var model = this.options.model || this.field_manager.get_field_value(this.options.model_field); - var domain = pyeval.eval('domain', this.get('value')); + try{ + var domain = pyeval.eval('domain', this.get('value')); + } + catch(e){ + this.do_warn(_t('Error: Bad domain'), _t('The domain is wrong.')); + return; + } var ds = new data.DataSetStatic(self, model, self.build_context()); ds.call('search_count', [domain]).then(function (results) { self.$('.o_count').text(results + _t(' selected records'));