From e6a2d222d6e2605ce360febe5d535511444421eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 18 Sep 2014 11:03:18 +0200 Subject: [PATCH] [FIX] correctly expand many2ones in autocompletion The ManyToOneField widget evaluated the domain before doing a name_search, but the domain should not be evaluated client side, because it can only be static at that point. It caused crash in autocompletion because some variables could not be found in the context (see stage_id in project.task for example) --- addons/web/static/src/js/search.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 3b2a54440f3..f14b8c010f1 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1636,8 +1636,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ 'contexts', [this.view.dataset.get_context()]); return this.model.call('name_search', [], { name: needle, - args: instance.web.pyeval.eval( - 'domains', this.attrs.domain ? [this.attrs.domain] : [], context), + args: (typeof this.attrs.domain === 'string') ? [] : this.attrs.domain, limit: 8, context: context }).then(function (results) {