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)
'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) {