From 2223ba5600875eb1d92ec1c70feacd60ebe6a96b Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 12 Feb 2014 15:13:46 +0100 Subject: [PATCH] [FIX] search view: slightly more readable error when search filters fail to evaluate Prints the error details instead of: Uncaught TypeError: Cannot read property 'length' of undefined' addons/web/static/src/js/views.js bzr revid: odo@openerp.com-20140212141346-hpw05sv3ctr243db --- addons/web/static/src/js/views.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 82a2095bace..eed98f9fc31 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -815,6 +815,11 @@ instance.web.ViewManager = instance.web.Widget.extend({ contexts: [action_context].concat(contexts || []), group_by_seq: groupbys || [] }).done(function (results) { + if (results.error) { + throw new Error( + _.str.sprintf(_t("Failed to evaluate search criterions")+": \n%s", + JSON.stringify(results.error))); + } self.dataset._model = new instance.web.Model( self.dataset.model, results.context, results.domain); var groupby = results.group_by.length